[PATCH] MI: new timing command
Nick Roberts
nickrob@snap.net.nz
Sat Jan 27 22:12:00 GMT 2007
> > + usec = get_run_time ();
> > + tv->wallclock.tv_sec = usec/1000000;
> > + tv->wallclock.utv_sec = usec - 1000000*tv->wallclock.tv_sec;
> > + tv->rusage.ru_utime.tv_sec = 0;
> > + tv->rusage.ru_utime.tv_usec = 0;
> > + tv->rusage.ru_stime.tv_sec = 0;
> > + tv->rusage.ru_stime.tv_usec = 0;
> > + #endif
> > + }
>
> Also note that this line:
>
> > + tv->wallclock.utv_sec = usec - 1000000*tv->wallclock.tv_sec;
>
> has a typo: it uses utv_sec instead of tv_usec.
I don't think so as get_run_time returns the time in microseconds e.g
usec = 1234567
tv->wallclock.tv_sec = 1234567/1000000 = 1
tv->wallclock.utv_sec = 1234567 - 1000000 = 234567
--
Nick http://www.inet.net.nz/~nickrob
More information about the Gdb-patches
mailing list