This commit is contained in:
2025-12-06 00:45:03 +05:30
parent 5ea25c9368
commit 0476ed2392
2 changed files with 8 additions and 1 deletions

View File

@ -36,6 +36,12 @@ namespace IACore
Logger::Terminate(); Logger::Terminate();
} }
UINT64 GetUnixTime()
{
auto now = std::chrono::system_clock::now();
return std::chrono::duration_cast<std::chrono::seconds>(now.time_since_epoch()).count();
}
UINT64 GetTicksCount() UINT64 GetTicksCount()
{ {
return std::chrono::duration_cast<std::chrono::milliseconds>(HighResClock::now() - g_startTime).count(); return std::chrono::duration_cast<std::chrono::milliseconds>(HighResClock::now() - g_startTime).count();
@ -43,7 +49,7 @@ namespace IACore
FLOAT64 GetSecondsCount() FLOAT64 GetSecondsCount()
{ {
return std::chrono::duration_cast<std::chrono::seconds>(HighResClock::now() - g_startTime) .count(); return std::chrono::duration_cast<std::chrono::seconds>(HighResClock::now() - g_startTime).count();
} }
UINT32 GetRandom(IN UINT32 seed) UINT32 GetRandom(IN UINT32 seed)

View File

@ -27,6 +27,7 @@ namespace IACore
// Must be called from same thread as Initialize // Must be called from same thread as Initialize
VOID Terminate(); VOID Terminate();
UINT64 GetUnixTime();
UINT64 GetTicksCount(); UINT64 GetTicksCount();
FLOAT64 GetSecondsCount(); FLOAT64 GetSecondsCount();