> On 2011-01-13 23:50:52, Nathan Binkert wrote: > > src/base/time.cc, line 89 > > <http://reviews.m5sim.org/r/425/diff/1/?file=9565#file9565line89> > > > > Oh, I used whatever you used. CLOCK_REALTIME is fine too, though I > > guess I never really cared about the fact that I could print the time as a > > string. I am generally more interested in using it for measuring how long > > things take. I hesitate to make this code more complex, but I guess I > > could create a set_wallclock() func that does one and a set_timer() that > > does the other.
Yeah, CLOCK_MONOTONIC is probably better in a lot of ways since the simulation shouldn't generally care what the actual time is, and it avoids some issues. It would be nice to make gettimeofday more like clock_gettime with CLOCK_MONOTONIC than the other way around, if that's possible. You could have set() just do what it's doing now and a set_wallclock() (setWallclock() since it's a member of a class?) for the less commonly useful wall time. - Gabe ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.m5sim.org/r/425/#review737 ----------------------------------------------------------- On 2011-01-13 19:43:31, Nathan Binkert wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.m5sim.org/r/425/ > ----------------------------------------------------------- > > (Updated 2011-01-13 19:43:31) > > > Review request for Default, Ali Saidi, Gabe Black, Steve Reinhardt, and > Nathan Binkert. > > > Summary > ------- > > time: improve time datastructure > > Use posix clock functions (and librt) if it is available. > Inline a bunch of functions and implement more operators. > > I needed something like this for some timing code that I needed, so I just > did it right since I assume that Gabe could use this to better his patch. > > > Diffs > ----- > > SConstruct de7601e6e19d > src/base/time.hh de7601e6e19d > src/base/time.cc de7601e6e19d > src/sim/stat_control.cc de7601e6e19d > > Diff: http://reviews.m5sim.org/r/425/diff > > > Testing > ------- > > quick regressions pass > > > Thanks, > > Nathan > >
_______________________________________________ m5-dev mailing list m5-dev@m5sim.org http://m5sim.org/mailman/listinfo/m5-dev