Reputation: 497
I have an operation that needs to be run once every day at 12 AM. I have implemented the same by using Condition check constraints matching DateTime.Now.Hour == someValue;
However, I don't want the while loop to be running n number of times for just one time operation. I have made the thread to sleep But still I ain't satisfied with the solution. Trying out with Timers will also wont work out. Do we have any concepts called Clock or Time coupled with events which invokes a particular action on a respective time. Please clarify.
Upvotes: 0
Views: 50
Reputation: 9489
some options:
in short, timers help avoid constant polling.. and Sleep allows you to regulate your polls. better than an insane while loop, which might affect CPU.
Upvotes: 1