/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/Platform/OSX/Time_OSX.cpp
24 строки
616 B
Ingrater
Clang-format fixes and update to 18.1.1 (#1234)
10 мар 2024, 15:51
Не верифицирован
10 мар 2024, 15:51
2f16acf
Код
Авторство
О чём код?
#include <Foundation/FoundationPCH.h> #if EZ_ENABLED(EZ_PLATFORM_OSX) # include <CoreServices/CoreServices.h> # include <mach/mach.h> # include <mach/mach_time.h> static double g_TimeFactor = 0; void ezTime::Initialize() { mach_timebase_info_data_t TimebaseInfo; mach_timebase_info(&TimebaseInfo); g_TimeFactor = (double)TimebaseInfo.numer / (double)TimebaseInfo.denom / (double)1000000000LL; } ezTime ezTime::Now() { // mach_absolute_time() returns nanoseconds after factoring in the mach_timebase_info_data_t return ezTime::MakeFromSeconds((double)mach_absolute_time() * g_TimeFactor); } #endif