P is for Practical | |
PerlMonks |
Re: Strange behavior with Benchmarkby aitap (Curate) |
on Apr 08, 2013 at 20:28 UTC ( [id://1027591]=note: print w/replies, xml ) | Need Help?? |
This is because speed computations are done by CPU time, and a program doesn't use any CPU time while sleeping. Moreover, "real" (CPU + "other things") time is computed using time(2) and thus is measured in seconds, not any more precisely. You can still try to count the real execution time by using timeit and its returned Benchmark object:
In Section
Seekers of Perl Wisdom
|
|