移植:timeGetTime() 在linux 下实现

#include <time.h> 
unsigned int timeGetTime()
{
        unsigned int uptime = 0;
        struct timespec on;
        if(clock_gettime(CLOCK_MONOTONIC, &on) == 0)
                 uptime = on.tv_sec*1000 + on.tv_nsec/1000000;
        return uptime;
}

你可能感兴趣的:(linux,struct,include)