Switch to hrtime for improved accuracy.

Based on Acubed's work.