GNOME Bugzilla – Bug 88768
GTimer patch for elapsed time
Last modified: 2011-02-18 15:55:17 UTC
The current version of GTimer will only return the time elapsed since the last call to g_timer_start(). Thus repeated calls to g_timer_start() and g_timer_stop() on the same instance of a GTimer will not result in the total elapsed time being returned by g_timer_elapsed(). This patch adds the following: - g_timer_total_elapsed() : returns the total elapsed time that the timer has been running since g_timer_new() or g_timer_reset() was called - g_timer_is_active() : returns whether or not the timer is currently running - doc strings for gtkdoc have been added to all functions - The existing behaviour is preserved
Created attachment 10003 [details] [review] Patches gtimer.c and gtimer.h to add total elapsed time support
I have some doubts whether an API addition in this area is really a good idea, see: http://mail.gnome.org/archives/gtk-devel-list/2002-July/msg00198.html
I'm not going to take this patch; I don't think the utility is worth the complexity. I filed bug 98536 about the idea of adding g_timer_continue(), which I think could be of some use, and would at least make the API look more sensible than it does currently. (dubious justification, but... :-)