On Tue, Aug 19, 2008 at 9:37 AM, Bas van Dijk <[EMAIL PROTECTED]> wrote:
> On Tue, Aug 19, 2008 at 8:49 AM, Johan Tibell <[EMAIL PROTECTED]> wrote:
>> benchpress is a micro-benchmark library that produces statistics such
>> as min, mean, standard deviation, median, and max execution time. It
>> also computes execution time percentiles.
>
> Nice, I'm certainty going to use this. Thanks!
>
> It would be even nicer if you could also measure the elapsed CPU time
> (using System.CPUTime.getCPUTime). Than the measurement is not
> influenced by time spent in other processes and IO time.

Thanks. I will ponder how to best expose this in the interface. An
option would be to return a tuple of Stats records where the first
component is the wall clock time and the second is the CPU time. I
might have to run the action twice to avoid extra measuring overhead.
For example, in

startCpu <- getCPUTime
startWall <- getCurrentTime
action
endWall <- getCurrentTime
endCpu <- getCPUTime

the measured time includes the two calls to getCurrentTime. Running
the action twice will double the benchmark running time which might or
might not matter.

Cheers,

Johan
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to