Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Benchmark Timer explanations

by mifflin (Curate)
on Jun 13, 2005 at 15:04 UTC ( [id://466190]=note: print w/replies, xml ) Need Help??


in reply to Benchmark Timer explanations

Joost is correct, it does mean micro seconds.
Here is the timestr sub in Benchmark::Timer that creates the string...
sub timestr { my $sec = shift; my $retstr; if($sec >= 1_000) { $retstr = commify(int $sec) . 's'; } elsif($sec >= 1) { $retstr = sprintf $sec == int $sec ? '%ds' : '%0.3fs', $sec; } elsif($sec >= 0.001) { my $ms = $sec * 1_000; $retstr = sprintf $ms == int $ms ? '%dms' : '%0.3fms', $ms; } elsif($sec >= 0.000001) { $retstr = sprintf '%dus', $sec * 1_000_000; } else { # I'll have whatever real-time OS she's having $retstr = $sec . 's'; } $retstr; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://466190]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-24 07:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found