Abstract out gettimeofday usage.