#ifdef _WIN32 #include #include #include /* gettimeofday function called 'ftime' in windows.. */ double getmillis_() { struct _timeb tbuf; double timeNow; _ftime( &tbuf ); timeNow= (double)(tbuf.time - 1000000000); timeNow += (double)tbuf.millitm * 0.001; return timeNow; } #else #include #include double getmillis_() { struct timeval times; double timeNow; gettimeofday( ×, NULL ); timeNow = (times.tv_sec -1000000000) + times.tv_usec*1.0e-06; return timeNow; } #endif