Timer without form

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I am writing a windows service and don't want a form or any other UI element
in it. How can I implement timer in this case to run a piece of code every
hour?

Thanks

Regards
 
Hi

I am writing a windows service and don't want a form or any other UI element
in it. How can I implement timer in this case to run a piece of code every
hour?

Thanks

Regards

In a windows service, you'll want to use System.Timers.Timer or
System.Threading.Timer...
 
Don't use a timer, sleep the thread.

System.Threading.Thread.CurrentThread.Sleep(New TimeSpan(1, 0, 0))

Bob
 
Back
Top