I am writing a Windows Service and I need to have the service perform some function at 10 past and 40 past every hour. How do I set up the timer to do this? I am assuming I would use system.timers.timer somehow? Thanks for your help.
Yes, you can do it by using a System.Timers.Timer. All you would need to to is to set the Interval property so that it fires every x minutes and then check the current time (System.DateTime.Now) to see if it is the time that you want to fire the relevant code.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.