Replace clock_gettime with gettimeofday because OS X sucks