Replace clock_gettime with gettimeofday.