CTimeT cTimeGetNanoTimePort(void) { #ifdef HAVE_POSIX_CLOCKS struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); return (UInt64)now.tv_sec*1000000000LL + now.tv_nsec; #else CTimeT t; t = cTimeGetTimePort(); return ((UInt64)t)*1000000; #endif }
/** * get the gmt time */ CTimeT cTimeGetTime(void) { return cTimeGetTimePort(); }
/** * get date of the specified timezone, if need GMT date, set param z to 0 */ void cTimeGetDate(CDateT* d, Float32 z) { if(d) { CTimeT t = cTimeGetTimePort(); cTimeTime2Date(t, d, z); } }