Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I check how much time remains before timer fires next event?

Tags:

c#

For example, I have set timer1.Interval to 5000 and I would like to know how much of this interval remains before the timer ticks. How I can do it?

like image 659
annayak Avatar asked Feb 20 '23 09:02

annayak


1 Answers

How to check timer time?

You cannot. The timer classes offer no way check how long remains before a timer is due to fire. The best you can do is to keep track of when the timer last fired and calculate yourself how long remains before the next tick.

like image 127
David Heffernan Avatar answered Feb 22 '23 23:02

David Heffernan