in reply to Measuring time intervals using Time::HiRes -- time vs. gettimeofday and tv_interval

Here's the source for tv_interval:
sub tv_interval { # probably could have been done in C my ($a, $b) = @_; $b = [gettimeofday()] unless defined($b); (${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000); }
That should explain everything, I think.

---
It's all fine and dandy until someone has to look at the code.
  • Comment on Re: Measuring time intervals using Time::HiRes -- time vs. gettimeofday and tv_interval
  • Select or Download Code