| 132 | #endif |
| 133 | #include <windows.h> |
| 134 | static __inline__ double second(void) |
| 135 | { |
| 136 | LARGE_INTEGER t; |
| 137 | static double oofreq; |
| 138 | static int checkedForHighResTimer; |
| 139 | static BOOL hasHighResTimer; |
| 140 | |
| 141 | if (!checkedForHighResTimer) { |
| 142 | hasHighResTimer = QueryPerformanceFrequency(&t); |
| 143 | oofreq = 1.0 / (double)t.QuadPart; |
| 144 | checkedForHighResTimer = 1; |
| 145 | } |
| 146 | |
| 147 | if (hasHighResTimer) { |
| 148 | QueryPerformanceCounter(&t); |
| 149 | return (double)t.QuadPart * oofreq; |
| 150 | } |
| 151 | else { |
| 152 | return (double)GetTickCount() / 1000.0; |
| 153 | } |
| 154 | } |
| 155 | #elif defined(__linux__) || defined(__QNX__) |
| 156 | #include <stddef.h> |
| 157 | #include <sys/resource.h> |
no outgoing calls