double Common::getTime() { #ifdef _WIN32 FILETIME ft; double t; GetSystemTimeAsFileTime(&ft); t = ft.dwLowDateTime/1.0e7 + ft.dwHighDateTime*(4294967296.0/1.0e7); return (t - 11644473600.0); #else struct timeval v; gettimeofday(&v, (struct timezone *) NULL); return v.tv_sec + v.tv_usec/1.0e6; #endif }
|