This commit is contained in:
jeka committed 2026-02-28 15:15:34 +03:00
1 parent b27ea97055
commit 9d0223d3fa
19 files changed
+87 -1496

No files matched your search

+15
View File
@@ -301,6 +301,21 @@ static void get_current_time(struct timeval* tv) {
#endif
}
#ifdef _WIN32
uint64_t get_time_tb(void) {
LARGE_INTEGER freq, count;
QueryPerformanceFrequency(&freq); // Получаем частоту таймера
QueryPerformanceCounter(&count); // Получаем текущее значение счётчика
return (uint64_t)(count.QuadPart * 10000) / (uint64_t)freq.QuadPart; // Преобразуем в требуемые единицы времени
}
#else
uint64_t get_time_tb(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (uint64_t)ts.tv_sec * 10000ULL + (uint64_t)ts.tv_nsec / 100000ULL; // Преобразуем в требуемые единицы времени
}
#endif
// Drain wakeup pipe - read all available bytes