2
I am developing a program that contains more than 10 threads running ... has emerged the need to have two timers, one to block and the other to release a process, so I am using Winforms timerControl ...
who initially are: timer.Enable = false / timer.Interval = 100;
at the right time, I put them this way: timer.Interval = 60000 (1min) /timer.Enable = true
;
but they never get active .... I have already tried using timer1.Start ()
together, but it didn’t work...
Does anyone know if this is because of the threads or not...
i don’t know much about C#, but if you use the windows API, you can use the method
GetTickCount
which is the millisecond count since the system started. It has a few tricks to restart after 40.5 days and does not increase in hibernated computers but is thread safe and can help you– Caputo
well I managed to use them in the following way leaving it active from the beginning and when the test condition is true I change your interval(inside the tick event was the only way to change)and so the condition ceases to be true mute again time.But what I really wanted is to find out the reason...but vlw
– Tamires
Who good, it’s always good to find solutions. If you want then you can answer your own question and mark it as correct, hence other people with the same question can also benefit from your solution.
– Caputo