'DateTime listener, listen to the minute changes
I want to listen to the minute changes, for example, if it is 6:00, I want to listen when it is 6:01 and then 6:02, and so on.
There are two ways (not good enough) that I can think of doing this.
I can setup a
Timer.periodicwhich runs every second and check for the change in minute.I can setup a
Timer.periodicwhich runs every second till the minute gets changed but after that it cancels itself and fires up anotherTimer.periodicwhich runs every minute.
Is there any better solution than these workarounds?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
