9/29 I'm timing an algorithm for cs170. The only library functions I
could find in c/c++ are time_t which is not precise enough. Is
there something that measures milleseconds? -thnx
\_ If this is that benchmarking thing for the strassen project, it's
totally bogus, there's no easy way to benchmark the way they
suggest. I just wrote something like what they said they wanted
and ran with it.. ~dbushong/pub/bench.c --dbushong
\_ In any case, _don't_ try running this on soda.. there are far
too many processes running for you to get any sort of accurate
timed benchmark.
\_ Try playing on EECS instructional machines. -- Grumpy
\_ try playing with gettimeofday(). -ERic
\_ getrusage() does microseconds and measures only time actually
spent on your process, not other processes
\_ gettimeofday() will get you absolute system time. getrusage()
gives you the amount of time the system kernel allocated to
your process, which on a heavily used multiuser system, could
be very different. --ERic
\_ How about /usr/bin/time, or the shell built-in "time"
command? -- yuen
\_ Those report both. |