http://www.perlmonks.org?node_id=1200806


in reply to Timer subtraction

Hello, a fast search return Time::Piece to be agood candidate for such subtraction, but it seems does not handles milliseconds

# pay attention to MSwin32 doublequotes perl -MTime::Piece -E "$t1=Time::Piece->strptime('23:58:59','%H:%M:%S' +);$t2=Time::Piece->strptime('23:56:58','%H:%M:%S');say $diff=($t1-$t2 +)" 121 # or directly subtracting perl -MTime::Piece -E "say Time::Piece->strptime('23:58:59','%H:%M:%S' +) - Time::Piece->strptime('23:56:58', '%H:%M:%S' )" 121

L*

PS Time::Hires and it's tv_interval supports millisecnds operations: see Re: time difference in milliseconds

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.