Can I use this code snippet as a complete replacement to traditional System.Timers
that will run for as long as my application/service is running?
System.Threading timer:
var timeToWait = TimeSpan.FromSeconds(20);
var interval = TimeSpan.FromMinutes(5);
var t = new Timer(s => OnTimedEvent(), null, timeToWait, interval);
System.Timers timer:
timer = new Timer(interval);
timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
timer.Start();
The System.Threading
version works for me so far so good, but are there any long term implications with the above code?