RE: Time::HiRes problems

2004-06-15 Thread Darrell Gammill
What do you get if you get the time as an array using gettimeofday? A difference would indicate it is a problem in the conversion of the system time format to a floating point format. The following is the relevant comment for the perldoc (see NOTE 2): time () Returns a floating seconds since

Re: Time::HiRes problems

2004-06-15 Thread $Bill Luebkert
Leigh Sharpe wrote: Hi all, I'm having some problems with the time reported by Time::HiRes::time(). I'm working on a non-blocking ping application, and using the system time to calculate round-trip-times. Basically, what I'm doing is: $start_time=time; send a ping. Do some other stuff

Re: Time::HiRes problems

2004-06-15 Thread Leigh Sharpe
Darrell Gammill [EMAIL PROTECTED] wrote: What do you get if you get the time as an array using gettimeofday? A difference would indicate it is a problem in the conversion of the system time format to a floating point format. Yes I have tried it. Same results. $Bill Luebkert [EMAIL

RE: Time::HiRes problems

2004-06-15 Thread Jan Dubois
I'm having some problems with the time reported by Time::HiRes::time(). ... Any idea what I'm doing wrong? Make sure that you are running version 1.53 of Time::HiRes or later: perl -MTime::HiRes -eprint$Time::HiRes::VERSION Earlier versions were acting more like Time::LoRes on Windows.

Re: Time::HiRes problems

2004-06-15 Thread Leigh Sharpe
Could be the problem. I'm using version 1.5 Is there a later one available for Perl 5.6? I can't use 5.8 on this project. - Original Message - From: Jan Dubois [EMAIL PROTECTED] To: 'Leigh Sharpe' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 11:22 AM Subject: RE:

RE: Time::HiRes problems

2004-06-15 Thread Jan Dubois
Hmm, it looks like 1.5 is the latest on PPM. It should be up to 1.59. I'll ping our build engineer to look into it... Cheers, -Jan On Tue, 15 Jun 2004, Leigh Sharpe wrote: Could be the problem. I'm using version 1.5 Is there a later one available for Perl 5.6? I can't use 5.8 on this project.

Re: Time::HiRes problems

2004-06-15 Thread $Bill Luebkert
Leigh Sharpe wrote: use Time::HiRes qw(gettimeofday tv_interval usleep); my $t0 = [gettimeofday ()]; usleep (1234); # sleep 1.234 msecs printf %.6f seconds\n, tv_interval ($t0); This is interesting. Using your example, if I change the usleep to 1000, I get a result of 0.010015 seconds. Using

RE: Time::HiRes problems

2004-06-15 Thread Jan Dubois
On Tue, 15 Jun 2004, $Bill Luebkert wrote: Leigh Sharpe wrote: This is interesting. Using your example, if I change the usleep to 1000, I get a result of 0.010015 seconds. Using usleep(999), I get 0.00 secs. A difference of 1 uS in the usleep causes a difference of 10mS in the result.

Re: Time::HiRes problems

2004-06-15 Thread $Bill Luebkert
Jan Dubois wrote: On Tue, 15 Jun 2004, $Bill Luebkert wrote: Leigh Sharpe wrote: This is interesting. Using your example, if I change the usleep to 1000, I get a result of 0.010015 seconds. Using usleep(999), I get 0.00 secs. A difference of 1 uS in the usleep causes a difference of 10mS