Search code examples
c#timeschedulerclockalarm

How to make some event on clock time?


I mean I want to make something: for example tomorrow at 6 a.m. ( clock based event )

For now the only variant I see is starting new timer with TimpeStamp from FutureTime - Now

But this solution looks ugly, specially when I will have many events it will force me to have many timers or somehow make timer process nearly event first and then re-calculate how long to wait on next event. And re-calculate each time when I will push new event to events collection.

Just asking if there is something more sane compared to my solution? Or maybe if there is already some free-for-use lib for it.


Solution

  • It's probably better to use the Windows Task Scheduler for this.

    See here for some details: Creating Scheduled Tasks