Re: [Freeciv-Dev] [PATCH] CHRONO
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Markus Linnala <maage@xxxxxxxxx> wrote:
> I see that you should use getrusage to time if you can. Because
> you get generally immunity to other load.
I used clock() for CPU time ("system time"), which I think
should be insensitive to load too? Or would getrusage still
be better than clock()? clock() does have somwhat poorer
resolution than gettimeofday, but since they're really measuring
different things probably both are useful.
(I wasn't sure whether to measure _both_ CPU and user time
in my "timer" struct. In the end I decided to let the user
decide which, and you can just use two separate timers if
you want to measure both. Or maybe have another layer of
structs and functions to automatically measure both...)
Regards,
-- David
|
|