c# - How to increment running timer -


in application define timer , set interval x seconds. after when 'click' event occurs want increment running timer y more seconds.

how can this?

the code sample:

private static timer stimer = new timer(); stimer.interval = 50000; 

when event invoked want that:

stimer.interval = timeleftinms + 5000; 

you should create custom timer, inherits system.timers.

have private stopwatch stopwatch = new stopwatch(); private member.

on timer.start: stopwatch.start();

on timer.tick: stopwatch.reset();

on

timer.interval            set {                    _timer.interval = _timer.interval -                      stopwatch.elapsed.miliseconds + value;               } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -