This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] MI: new timing command


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]