Re: keeping track of time.



John Vetterli wrote:
[...]
Use g_timeout_add to execute a callback function periodically.
http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html

The interval may not be terribly accurate, but if I understand your needs, this is not important. The callbacks would only cause the widget to be updated, not for calculating the time elapsed. The time elapsed can always be calculated by comparing the current system time and the start time (see "man 2 time").

Just incase you've missed it, you can also use GTimer to calculate
elapsed time.

Cheers,
                              -Tristan



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