Use gettimeofday/tv_interval on systems where it's implemented:

  my $t = [gettimeofday];
  # do whatever ...
  my $time_taken = tv_interval($t);
  print "Seconds to do <whatever>: $time_taken\n";

----
Steve Sapovits
Global Sports Interactive
Work Email: [EMAIL PROTECTED]
Home Email: [EMAIL PROTECTED]
Work Phone: 610-491-7087
Cell:       610-574-7706
Pager:      877-239-4003

> -----Original Message-----
> From: Ted Hilts [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, March 19, 2001 11:42 PM
> To:   [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject:      Perl - Time Tracking
> 
> This is my second perl problem.
> 
> I have this ftp routine and want to be able to measure the time
> associated with each step in the routine.  You can see a routine snippet
> on the list where I submitted the first problem and it is called Perl
> Problem.
> 
> Before each $ftp step I want to be able to set up a condition so that
> when the step completes I can determine how long the $ftp step took.  So
> I want an ongoing determination of the time in the form of time
> durations, not just a print out of what time it is.  By this means I can
> monitor the routine and become aware of any problems.  Also, I would
> like to be able (withing the perl code) to detect any time durations
> exceeding a specified amount.
> 
> Thanking you in advance for any help.
> 
> Bye-thanks_TED

Reply via email to