I’m working with a windows service and they are so hard to test, so would like to leave it as a empty as possible only importing classes.
I need to use a Timer to trigger and event every 5 minutes, but if i use the timer component i have to place it on my windows service.
So is it possible to build my own basic timer class ??
How would i go about this? i want to to be very small and light, a few lines of code if possible.
You can use System.Timers.Timer or System.Threading.Timer
From MSDN
Timer elapsed event handler
You wont be requiring timer component in this case
Here is the complete article on Timers in .Net. Complete comparison between different type of timers is discussed here.