Re: GTimers - do they need initialization ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, &microseconds);
    printf ("Time elapsed = %d.%06lu\n", (int) seconds, microseconds);
    g_usleep (1000000);
  } while (seconds < 10);

  return 0;
}

--tml
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux