1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
6 keep track of elapsed time.
8 <!-- ##### SECTION Long_Description ##### -->
10 #GTimer records a start time, and counts microseconds elapsed since that time.
11 This is done somewhat differently on different platforms, and can be tricky to
12 get exactly right, so #GTimer provides a portable/convenient interface.
15 <!-- ##### SECTION See_Also ##### -->
20 <!-- ##### SECTION Stability_Level ##### -->
23 <!-- ##### STRUCT GTimer ##### -->
25 Opaque datatype that records a start time.
29 <!-- ##### FUNCTION g_timer_new ##### -->
31 Creates a new timer, and starts timing (i.e. g_timer_start() is implicitly
35 @Returns: a new #GTimer.
38 <!-- ##### FUNCTION g_timer_start ##### -->
40 Marks a start time, so that future calls to g_timer_elapsed() will report the
41 time since g_timer_start() was called. g_timer_new() automatically marks the
42 start time, so no need to call g_timer_start() immediately after creating the
49 <!-- ##### FUNCTION g_timer_stop ##### -->
51 Marks an end time, so calls to g_timer_elapsed() will return the difference
52 between this end time and the start time.
58 <!-- ##### FUNCTION g_timer_continue ##### -->
60 Resumes a timer that has previously been stopped with g_timer_stop().
61 g_timer_stop() must be called before using this function.
68 <!-- ##### FUNCTION g_timer_elapsed ##### -->
70 If @timer has been started but not stopped, obtains the time since the timer was
71 started. If @timer has been stopped, obtains the elapsed time between the time
72 it was started and the time it was stopped. The return value is the number of
73 seconds elapsed, including any fractional part. The @microseconds
74 out parameter is essentially useless.
78 @microseconds: fractional part of seconds elapsed, in microseconds
79 (that is, the total number of microseconds elapsed, modulo
81 @Returns: seconds elapsed as a floating point value, including
85 <!-- ##### FUNCTION g_timer_reset ##### -->
87 This function is useless; it's fine to call g_timer_start() on an
88 already-started timer to reset the start time, so g_timer_reset() serves no
95 <!-- ##### FUNCTION g_timer_destroy ##### -->
97 Destroys a timer, freeing associated resources.
100 @timer: a #GTimer to destroy.