Re: [PATCH] MI: new timing command

Nick Roberts
2007-01-27T22:12:56Z

> > + 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