| 66 | |
| 67 | |
| 68 | uint32 Timer_GetTime(void) |
| 69 | { |
| 70 | #if defined(_MSC_VER) |
| 71 | DWORD t; |
| 72 | t = timeGetTime(); |
| 73 | return t; |
| 74 | #elif defined(TOS) |
| 75 | /* use the 200 HZ system timer which has a 5ms granularity */ |
| 76 | return get_sysvar(_hz_200) * 5; |
| 77 | #elif defined(__WATCOMC__) |
| 78 | return clock() * 1000 / CLOCKS_PER_SEC; |
| 79 | #else |
| 80 | struct timeval tv; |
| 81 | gettimeofday(&tv, NULL); |
| 82 | return tv.tv_sec * 1000 + tv.tv_usec / 1000; |
| 83 | #endif /* _MSC_VER */ |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Run the timer interrupt handler. |
no outgoing calls
no test coverage detected