Re: [Nagios-devel] Silly precision in a timing macros

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Silly precision in a timing macros

Post by Guest »

This is a multi-part message in MIME format...

------------=_1099007501-32164-355
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Dear Folks,

On Thu, Oct 28, 2004 at 03:59:31PM -0700, Jason Martin wrote:
> 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).

Timer resolution this may be a platform dependent ability.

> 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:
>

I think you will find that this module is an XS (Perl eXtension) that
calls the system's gettimeofday(), a function that may not be POSIX and
whose resolution varies.

> #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?

BSD systems have a gettimeofday that returns microsecs.

Do you really need this accuracy ?

Milliseconds are fine for me. Prob Seconds are also.

>
> -Jason Martin

Yours sincerely.


--
Stanley Hopcroft

Network specialist, IT Infrastructure
IP Australia
Ph: (02) 6283 3189 Fax: (02) 6281 1353
PO Box 200 Woden ACT 2606
http://www.ipaustralia.gov.au

------------=_1099007501-32164-355
Content-Type: text/plain; name="disclaimer.txt"
Content-Disposition: inline; filename="disclaimer.txt"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
X-Mailer: MIME-tools 5.411 (Entity 5.404)


--
This message contains privileged and confidential information only
for use by the intended recipient. If you are not the intended
recipient of this message, you must not disseminate, copy or use
it in any manner. If you have received this message in error,
please advise the sender by reply e-mail. Please ensure all
e-mail attachments are scanned for viruses prior to opening or
using.

------------=_1099007501-32164-355--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked