// 计时函数 __int64 XGetTickCount() { __int64 nTick = 0; #ifdef WIN32 static __int64 nFrequency = 0; if(nFrequency || QueryPerformanceFrequency((LARGE_INTEGER *)&nFrequency)) { QueryPerformanceCounter((LARGE_INTEGER *)&nTick); nTick = nTick * 1000000 / nFrequency; } #else struct timeval tmVal; struct timezone tmZone; gettimeofday( &tmVal, &tmZone ); nTick = (__int64)tmVal.tv_sec * 1000000 + tmVal.tv_usec; #endif return nTick; }