| 273 | #define MS 10000000 |
| 274 | |
| 275 | static void win_init_time(void) |
| 276 | { |
| 277 | /* The following is used by time functions */ |
| 278 | FILETIME ft; |
| 279 | LARGE_INTEGER li, t_cnt; |
| 280 | |
| 281 | DBUG_ASSERT(sizeof(LARGE_INTEGER) == sizeof(query_performance_frequency)); |
| 282 | |
| 283 | if (QueryPerformanceFrequency((LARGE_INTEGER *)&query_performance_frequency) == 0) |
| 284 | query_performance_frequency= 0; |
| 285 | else |
| 286 | { |
| 287 | GetSystemTimeAsFileTime(&ft); |
| 288 | li.LowPart= ft.dwLowDateTime; |
| 289 | li.HighPart= ft.dwHighDateTime; |
| 290 | query_performance_offset= li.QuadPart-OFFSET_TO_EPOC; |
| 291 | QueryPerformanceCounter(&t_cnt); |
| 292 | query_performance_offset-= (t_cnt.QuadPart / |
| 293 | query_performance_frequency * MS + |
| 294 | t_cnt.QuadPart % |
| 295 | query_performance_frequency * MS / |
| 296 | query_performance_frequency); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | |
| 301 | /* |