コード例 #1
0
ファイル: ctimeport.c プロジェクト: Grainspring/xoc
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
}
コード例 #2
0
ファイル: ctime.c プロジェクト: Alibaba-boonya/xoc
/**
* get the gmt time
*/
CTimeT cTimeGetTime(void) {
    return cTimeGetTimePort();
}
コード例 #3
0
ファイル: ctime.c プロジェクト: Alibaba-boonya/xoc
/**
* 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);
    }
}