关于win32 gettimeofday替代方案
来自nginx代码:
void ngx_gettimeofday(structtimeval*tp) { uint64_tintervals; FILETIMEft; GetSystemTimeAsFileTime(&ft); /* *Afiletimeisa64-bitvaluethatrepresentsthenumber *of100-nanosecondintervalsthathaveelapsedsince *January1,160112:00A.M.UTC. * *BetweenJanuary1,1970(Epoch)andJanuary1,1601therewere *134744days, *11644473600secondsor *11644473600,000,000,0100-nanosecondintervals. * *SeealsoMSKBQ167296. */ intervals=((uint64_t)ft.dwHighDateTime<<32)|ft.dwLowDateTime; intervals-=116444736000000000; tp->tv_sec=(long)(intervals/10000000); tp->tv_usec=(long)((intervals%10000000)/10); }
以上就是小编为大家带来的关于win32gettimeofday替代方案全部内容了,希望大家多多支持毛票票~