Re: pause/resume timer



Johannes WeiÃl wrote:
Hello,

is it possible to pause/resume a started GTimer?!
If not, is there a portable (the program should
run on Windows and Linux) solution for this problem?


It should be easy to create such functionality by inside a new type that uses GTimer to do the actual timing. Translate pause/resume on your new type into stop/start on an underlying timer. Just before calling g_timer_start on resume get the result of g_timer_elapsed and add it to a tally of "extra time". The actual elapsed time will be the sum of this "extra time" and the result of calling g_timer_elapsed on the underlying GTimer.

--
Tim Evans
Applied Research Associates NZ
http://www.aranz.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]