mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-18 18:14:54 +00:00
Revert "msvc: use std::chrono for GetLocalTimeSinceJan1970"
This reverts commit 86da6c98fb
.
This commit is contained in:
parent
7b2b559743
commit
292724b228
1 changed files with 1 additions and 7 deletions
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
#include <ctime>
|
||||||
#include <timeapi.h>
|
#include <timeapi.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
@ -67,12 +68,6 @@ u64 Timer::ElapsedMs() const
|
||||||
|
|
||||||
u64 Timer::GetLocalTimeSinceJan1970()
|
u64 Timer::GetLocalTimeSinceJan1970()
|
||||||
{
|
{
|
||||||
#ifdef _MSC_VER
|
|
||||||
std::chrono::zoned_seconds seconds(
|
|
||||||
std::chrono::current_zone(),
|
|
||||||
std::chrono::time_point_cast<std::chrono::seconds>(std::chrono::system_clock::now()));
|
|
||||||
return seconds.get_local_time().time_since_epoch().count();
|
|
||||||
#else
|
|
||||||
time_t sysTime, tzDiff, tzDST;
|
time_t sysTime, tzDiff, tzDST;
|
||||||
time(&sysTime);
|
time(&sysTime);
|
||||||
tm* gmTime = localtime(&sysTime);
|
tm* gmTime = localtime(&sysTime);
|
||||||
|
@ -88,7 +83,6 @@ u64 Timer::GetLocalTimeSinceJan1970()
|
||||||
tzDiff = sysTime - mktime(gmTime);
|
tzDiff = sysTime - mktime(gmTime);
|
||||||
|
|
||||||
return static_cast<u64>(sysTime + tzDiff + tzDST);
|
return static_cast<u64>(sysTime + tzDiff + tzDST);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timer::IncreaseResolution()
|
void Timer::IncreaseResolution()
|
||||||
|
|
Loading…
Add table
Reference in a new issue