change file mode
revert to using gettimeofday for Mac OS (no clock_gettime support).