Currently, I have functions in my service which are called in different threads on timer event(every 10 mins) in window service written in 4.0 framework like this:
public void OnTimer(object sender, System.Timers.ElapsedEventArgs args)
{
Task.Factory.StartNew(() => ABC());
Task.Factory.StartNew(() => DEF());
Task.Factory.StartNew(() => GHI());
Task.Factory.StartNew(() => IJK());
Task.Factory.StartNew(() => LMN());
}
I want to have different time interval/timer event for each thread. One possible solution is to create new timer object and call each function in different timer event. Is there other optimized way ? In future, if service contains 50 functions then I would have to create 50 objects of timer.