> Why not Wait(timetowaitfor). Not a duration; the actual time you want to be woken up. Now it still takes time to wake up and run. And it takes time to make the call. But now, your stuff actually runs say 60 times per minute (e.g. if you wait for successive seconds), hour after hour and day after day.
There's a lot of "what ifs" that need to be answered for something that seems so simple:
* What clock are you using? Machine ticks? Wall clock? Is it correct? Is it stable enough?
* What if the clock misses the time that I asked for? Do you run it anyway? Do you skip that invocation?
* What if the clock moves backwards? Will you trigger twice? Will you even notice?
* What if I have a leap second so there are 61 seconds in the hour? What if a second is removed so there are 59 seconds in the hour?
The reason why people don't touch this stuff or get it wrong is because it's really hard. There's a lot of corner cases when it comes to time handling.
There's a lot of "what ifs" that need to be answered for something that seems so simple:
* What clock are you using? Machine ticks? Wall clock? Is it correct? Is it stable enough?
* What if the clock misses the time that I asked for? Do you run it anyway? Do you skip that invocation?
* What if the clock moves backwards? Will you trigger twice? Will you even notice?
* What if I have a leap second so there are 61 seconds in the hour? What if a second is removed so there are 59 seconds in the hour?
The reason why people don't touch this stuff or get it wrong is because it's really hard. There's a lot of corner cases when it comes to time handling.