Run timer functions in Form

%3CLINGO-SUB%20id%3D%22lingo-sub-1983643%22%20slang%3D%22en-US%22%3ERun%20timer%20functions%20in%20Form%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1983643%22%20slang%3D%22en-US%22%3E%3CP%3EI%20created%20a%20form%20(System.Windows.Forms.Form)%20and%20add%202%20timer%20objects%20in%20it.%3C%2FP%3E%3CP%3ETimer1%20interval%20is%20set%20to%201%20second%20for%20displaying%20a%20clock%20on%20the%20form.%3C%2FP%3E%3CP%3ETimer2%20fires%20a%20function%20that%20varies%20in%20execution%20time%20from%200.3%20to%202%20seconds%20so%20I%20set%20the%20interval%20to%202%20seconds.%3C%2FP%3E%3CP%3EWhen%20running%2C%20the%20clock%20second%20display%20stops%20Intermittently%20because%20of%20Timer2%20function%20running.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20run%20Timer2%20function%20in%20parallel%20with%20the%20form%20so%20Timer1%20clock%20will%20not%20be%20affected%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3EIan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1983643%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Contributor

I created a form (System.Windows.Forms.Form) and add 2 timer objects in it.

Timer1 interval is set to 1 second for displaying a clock on the form.

Timer2 fires a function that varies in execution time from 0.3 to 2 seconds so I set the interval to 2 seconds.

When running, the clock second display stops Intermittently because of Timer2 function running.

 

Is it possible to run Timer2 function in parallel with the form so Timer1 clock will not be affected?

 

Thanks

Ian

0 Replies