| 511 | #if defined(_MSC_VER) || defined(__MINGW32__) |
| 512 | static int64_t timer_freq, timer_start; |
| 513 | void ggml_time_init(void) { |
| 514 | LARGE_INTEGER t; |
| 515 | QueryPerformanceFrequency(&t); |
| 516 | timer_freq = t.QuadPart; |
| 517 | |
| 518 | // The multiplication by 1000 or 1000000 below can cause an overflow if timer_freq |
| 519 | // and the uptime is high enough. |
| 520 | // We subtract the program start time to reduce the likelihood of that happening. |
| 521 | QueryPerformanceCounter(&t); |
| 522 | timer_start = t.QuadPart; |
| 523 | } |
| 524 | int64_t ggml_time_ms(void) { |
| 525 | LARGE_INTEGER t; |
| 526 | QueryPerformanceCounter(&t); |
no outgoing calls