Synopsis#include <glib.h> GTimer; GTimer* g_timer_new (void); void g_timer_start (GTimer *timer); void g_timer_stop (GTimer *timer); void g_timer_continue (GTimer *timer); gdouble g_timer_elapsed (GTimer *timer, gulong *microseconds); void g_timer_reset (GTimer *timer); void g_timer_destroy (GTimer *timer); DescriptionGTimer records a start time, and counts microseconds elapsed since that time. This is done somewhat differently on different platforms, and can be tricky to get exactly right, so GTimer provides a portable/convenient interface. Note
GTimer uses a higher-quality clock when thread support is available.
Therefore, calling Detailsg_timer_new ()GTimer* g_timer_new (void);
Creates a new timer, and starts timing (i.e.
g_timer_start ()void g_timer_start (GTimer *timer);
Marks a start time, so that future calls to
g_timer_stop ()void g_timer_stop (GTimer *timer);
Marks an end time, so calls to
g_timer_continue ()void g_timer_continue (GTimer *timer);
Resumes a timer that has previously been stopped with
Since 2.4 g_timer_elapsed ()gdouble g_timer_elapsed (GTimer *timer, gulong *microseconds);
If WarningCalling initialization functions, in particular
g_timer_reset ()void g_timer_reset (GTimer *timer);
This function is useless; it's fine to call
|