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