Re: GTimers - do they need initialization ?
- From: Tor Lillqvist <tml iki fi>
- To: John Emmas <johne53 tiscali co uk>
- Cc: gtk-list gnome org
- Subject: Re: GTimers - do they need initialization ?
- Date: Wed, 17 Mar 2010 13:47:53 +0200
Read the documentation for g_timer_elapsed() more closely.
#include <stdio.h>
#include <glib/gtimer.h>
int main (int argc, char* argv[])
{
double seconds;
gulong microseconds;
GTimer* pTimer = g_timer_new ();
do {
seconds = g_timer_elapsed (pTimer, µseconds);
printf ("Time elapsed = %d.%06lu\n", (int) seconds, microseconds);
g_usleep (1000000);
} while (seconds < 10);
return 0;
}
--tml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]