hrr has asked for the wisdom of the Perl Monks concerning the following question:
oruse Time::HiRes qw(gettimeofday tv_interval); $t0 = [gettimeofday]; $elapsed = tv_interval($t0)
Is one of these two methods preferrable, considering accuracy and performance? As both gettimeofday and time provide accuracy up to microseconds, it seems to me that the accuracy of both time intervals are equivalent.use Time::HiRes qw(time); $t0 = time; $elapsed = time - $t0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Measuring time intervals using Time::HiRes -- time vs. gettimeofday and tv_interval
by shonorio (Hermit) on Jul 18, 2006 at 19:14 UTC | |
by hrr (Monk) on Jul 18, 2006 at 19:33 UTC | |
by Ieronim (Friar) on Jul 18, 2006 at 19:53 UTC | |
by Tanktalus (Canon) on Jul 18, 2006 at 20:21 UTC | |
|
Re: Measuring time intervals using Time::HiRes -- time vs. gettimeofday and tv_interval
by kwaping (Priest) on Jul 18, 2006 at 22:53 UTC |