Silly precision in a timing macros

Jason Martin jhmartin at toger.us
Fri Oct 29 00:59:31 CEST 2004


On Thu, Oct 28, 2004 at 05:47:50PM -0500, Ethan Galstad wrote:
> > The precision provided by timing macros (for latency and executin
> > times) are a bit silly, since it holds room for 6 decimal points but
> > only ever uses 3 of them (a limit in the Linux kernel, I've heard).
I'm surprised about that; some of my perl scripts can print time
periods to 6 decimal points.

The perl module is Time::HiRes.
If I do something like this:

#Track execution time
my $t0 = [gettimeofday];
//[misc stuff]
print "Stored data for $var on $var2 in " . tv_interval($t0);

, I can get output such as:
Stored data for ****** on ****** in 0.004562s

Perhaps there is some other limitation causing the time
precision to be lowered?

-Jason Martin
-- 
This message is PGP/MIME signed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 211 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20041028/b28205f2/attachment.sig>


More information about the Developers mailing list