I have a pending application in which a Due is setup to count to a preset number, and when it reaches that number it promptly causes Digital D2 to go high and thus activate something. And it might not be the Due in the final design idea, I'm also looking at one of the Feathers from Adafruit. (Going to ask them roughly the same question next time.)
At least that's as far as my thought experiment took things.
For example in the BASIC world I could code it to do that easily. But I'm very rusty writing things in sketches for the Arduino Due and its related systems.