Re: g_timer_elapsed
- From: Owen Taylor <otaylor redhat com>
- To: Paulo Jorge de Oliveira Cantante de Matos <pdestroy netcabo pt>
- Cc: GTK+ Mailing List App Devel <gtk-app-devel-list gnome org>
- Subject: Re: g_timer_elapsed
- Date: 05 May 2001 09:58:02 -0400
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]