60 #include <sysinfoapi.h>
62 #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
63 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
65 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
68 int clock_gettime(
int clockid,
struct timespec *tp)
71 unsigned __int64 tmpres = 0;
76 GetSystemTimeAsFileTime(&ft);
78 tmpres |= ft.dwHighDateTime;
80 tmpres |= ft.dwLowDateTime;
84 tmpres -= DELTA_EPOCH_IN_MICROSECS;
85 tp->tv_sec = (long)(tmpres / 1000000UL);
86 tp->tv_nsec = (long)(tmpres % 1000000UL) * 1000;
101 clock_gettime(CLOCK_REALTIME, &tp);
104 st_time = *localtime(&tp.tv_sec);
106 st_time = *localtime_r(&tp.tv_sec, &buf_time);
109 strftime(pc_time,30,
"%d-%h-%y %T",&st_time);
110 return ((
CHARS *) pc_time);
CHARS * f_ut_time(CHARS *pc_time)