| #include "stat.h" | |
| #include <time.h> | |
| #include <windows.h> | |
| int clock_gettime(unsigned long int clock_id, struct timespec *tp) { | |
| int time; | |
| switch(clock_id){ | |
| case 1: | |
| time = timeGetTime(); | |
| tp->tv_sec = time / 1000; | |
| tp->tv_nsec = time * 1000000 - tp->tv_sec; | |
| return 0; | |
| default: | |
| return -1; | |
| } | |
| } |