If I have two system timers that fire events at 10 and 20 seconds respectively, are the event function calls multithreaded? In the scenario below, I have timers that fire events at intervals of 10 and 12 s respectively. It is assumed that the function "My10sEvent" will be called first. If it is a slow function that takes 8 seconds to run, will it block another event (tmr12s), or will the second event fire during 12 seconds?
System.Timers.Timer tmr10s = new System.Timers.Timer(10000.0); tmr10s.Enabled = true; tmr10s.Elapsed += new ElapsedEventHandler(My10sEvent); System.Timers.Timer tmr12s = new System.Timers.Timer(12000.0); tmr12s.Enabled = true; tmr12s.Elapsed += new ElapsedEventHandler(My12sEvent); Thread.Sleep(System.Threading.Timeout.Infinite);
user236520
source share