| 526 | #if defined(_MSC_VER) || defined(__MINGW32__) |
| 527 | static int64_t timer_freq, timer_start; |
| 528 | void ggml_time_init(void) { |
| 529 | LARGE_INTEGER t; |
| 530 | QueryPerformanceFrequency(&t); |
| 531 | timer_freq = t.QuadPart; |
| 532 | |
| 533 | // The multiplication by 1000 or 1000000 below can cause an overflow if timer_freq |
| 534 | // and the uptime is high enough. |
| 535 | // We subtract the program start time to reduce the likelihood of that happening. |
| 536 | QueryPerformanceCounter(&t); |
| 537 | timer_start = t.QuadPart; |
| 538 | } |
| 539 | int64_t ggml_time_ms(void) { |
| 540 | LARGE_INTEGER t; |
| 541 | QueryPerformanceCounter(&t); |
no outgoing calls