MCPcopy Create free account
hub / github.com/cppla/ServerStatus / time_get

Function time_get

server/src/system.c:528–545  ·  view source on GitHub ↗

----- time ----- */

Source from the content-addressed store, hash-verified

526
527/* ----- time ----- */
528int64 time_get()
529{
530#if defined(CONF_FAMILY_UNIX)
531 struct timeval val;
532 gettimeofday(&val, NULL);
533 return (int64)val.tv_sec*(int64)1000000+(int64)val.tv_usec;
534#elif defined(CONF_FAMILY_WINDOWS)
535 static int64 last = 0;
536 int64 t;
537 QueryPerformanceCounter((PLARGE_INTEGER)&t);
538 if(t<last) /* for some reason, QPC can return values in the past */
539 return last;
540 last = t;
541 return t;
542#else
543 #error not implemented
544#endif
545}
546
547int64 time_freq()
548{

Callers 3

NewClientCallbackMethod · 0.85
UpdateMethod · 0.85
OnNewClientMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected