Re: g_timer_elapsed



Paulo Jorge de Oliveira Cantante de Matos <pdestroy netcabo pt> writes:

Hi,
Pls check this code and its result:
Code:
#include <stdio.h>
#include <gtk\gtk.h>

int main(void) {
      GTimer *mytime;
      unsigned long msecs;
      double secs;
      unsigned long soma=1000;
      g_timer_reset(mytime);
      g_timer_start(mytime);
      for(;soma>0;soma--) g_print("duh");
      secs = g_timer_elapsed(mytime, &msecs);
      g_print("\n\n%d secs, %lu msecs", secs, msecs);
                     ^^                   ^^^^

If you are using GCC (perhaps not from gtk\gtk.h), compile
with -Wall and the compiler will catch stuff like
this.

Regards,
                                        Owen




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