c# - System.Threading.Timer ... Time of next fire? -


i have question timer. interval time count time of callback executions? mean example - have timer set fire every 15 seconds , executes callback function lasts approximately 3 seconds in time. when next time timer fire? in 18 seconds (after callback completes) or after 15 seconds (without waiting callback)??? in advance

it fire every 15 seconds regardless of callback execution time. if want include callback execution time, can suspend , restart timer in callback follows;

at start:

sometimer.change(timeout.infinite, timeout.infinite)

.. , @ end, change same method:

sometimer.change(timespan.fromseconds(15), timespan.fromseconds(15))


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -