Use clock() if gettimeofday() is not available.