Re: [Nagios-devel] Silly precision in a timing macros
Posted: Thu Oct 28, 2004 2:59 pm
--1mpN54+oXr72ab9j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
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 =3D [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
--=20
This message is PGP/MIME signed.
--1mpN54+oXr72ab9j
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: --no-verbose
iD8DBQFBgXnTl2ODWuqVSBMRAv9DAKCI9p0S03GaYHNgq3PAYWkqcYdD9wCeNhy7
4VG9LPyFJfix0XXL53sTzPo=
=6eZ7
-----END PGP SIGNATURE-----
--1mpN54+oXr72ab9j--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
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 =3D [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
--=20
This message is PGP/MIME signed.
--1mpN54+oXr72ab9j
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: --no-verbose
iD8DBQFBgXnTl2ODWuqVSBMRAv9DAKCI9p0S03GaYHNgq3PAYWkqcYdD9wCeNhy7
4VG9LPyFJfix0XXL53sTzPo=
=6eZ7
-----END PGP SIGNATURE-----
--1mpN54+oXr72ab9j--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]