MCPcopy Create free account
hub / github.com/AdvancedCompiler/AdvancedCompiler / gettimeofday

Function gettimeofday

code/Chapter10/freshman.h:22–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20#endif
21#ifdef _WIN32
22int gettimeofday(struct timeval *tp, void *tzp)
23{
24 time_t clock;
25 struct tm tm;
26 SYSTEMTIME wtm;
27 GetLocalTime(&wtm);
28 tm.tm_year = wtm.wYear - 1900;
29 tm.tm_mon = wtm.wMonth - 1;
30 tm.tm_mday = wtm.wDay;
31 tm.tm_hour = wtm.wHour;
32 tm.tm_min = wtm.wMinute;
33 tm.tm_sec = wtm.wSecond;
34 tm. tm_isdst = -1;
35 clock = mktime(&tm);
36 tp->tv_sec = clock;
37 tp->tv_usec = wtm.wMilliseconds * 1000;
38 return (0);
39}
40#endif
41double cpuSecond()
42{

Callers 11

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
cpuSecondFunction · 0.85
secondsFunction · 0.85
StartMethod · 0.85
StopMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected