After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 88768 - GTimer patch for elapsed time
GTimer patch for elapsed time
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2002-07-22 07:42 UTC by Gavin Baker
Modified: 2011-02-18 15:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patches gtimer.c and gtimer.h to add total elapsed time support (7.55 KB, patch)
2002-07-22 07:43 UTC, Gavin Baker
none Details | Review

Description Gavin Baker 2002-07-22 07:42:01 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
Comment 1 Gavin Baker 2002-07-22 07:43:19 UTC
Created attachment 10003 [details] [review]
Patches gtimer.c and gtimer.h to add total elapsed time support
Comment 2 Owen Taylor 2002-07-26 21:08:32 UTC
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

Comment 3 Owen Taylor 2002-11-14 22:52:02 UTC
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... :-)