Is it safe to use System.Threading.Timer in windows service running for a long time?
In other words, is the 49.7 days timer roll-over problem fixed in Windows Server 2003 32bit + .Net Framework 2.0?
Is Thread.Sleep() the only alternative?
Thank you.
Is it safe to use System.Threading.Timer in windows service running for a long time?
In other words, is the 49.7 days timer roll-over problem fixed in Windows Server 2003 32bit + .Net Framework 2.0?
Is Thread.Sleep() the only alternative?
Thank you.
Internal the periods are declared as UInt32, which does have a MaxValue of 4,294,967,295 , or with other words 49.7 days...so I wouldn't trust it to work the right way over such a long period. But, if I look at the reflected code, it should work if you destroy the timer every f.e. 5 days and create a new one.
Edit: As I think about it, Timers and Services don't play well together, you might wanna read this and this.