Merge pull request #7198 from ameerj/settings-chrono
settings: Remove std::chrono usage
This commit is contained in:
commit
c871320760
7 changed files with 20 additions and 24 deletions
|
@ -196,8 +196,9 @@ struct System::Impl {
|
|||
cpu_manager.Initialize();
|
||||
core_timing.Initialize([&system]() { system.RegisterHostThread(); });
|
||||
|
||||
const auto current_time = std::chrono::duration_cast<std::chrono::seconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch());
|
||||
const auto posix_time = std::chrono::system_clock::now().time_since_epoch();
|
||||
const auto current_time =
|
||||
std::chrono::duration_cast<std::chrono::seconds>(posix_time).count();
|
||||
Settings::values.custom_rtc_differential =
|
||||
Settings::values.custom_rtc.value_or(current_time) - current_time;
|
||||
|
||||
|
|
|
@ -13,18 +13,19 @@
|
|||
#include "core/hle/service/time/time_manager.h"
|
||||
|
||||
namespace Service::Time {
|
||||
|
||||
namespace {
|
||||
constexpr Clock::TimeSpanType standard_network_clock_accuracy{0x0009356907420000ULL};
|
||||
|
||||
static std::chrono::seconds GetSecondsSinceEpoch() {
|
||||
return std::chrono::duration_cast<std::chrono::seconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch()) +
|
||||
s64 GetSecondsSinceEpoch() {
|
||||
const auto time_since_epoch = std::chrono::system_clock::now().time_since_epoch();
|
||||
return std::chrono::duration_cast<std::chrono::seconds>(time_since_epoch).count() +
|
||||
Settings::values.custom_rtc_differential;
|
||||
}
|
||||
|
||||
static s64 GetExternalRtcValue() {
|
||||
return GetSecondsSinceEpoch().count() + TimeManager::GetExternalTimeZoneOffset();
|
||||
s64 GetExternalRtcValue() {
|
||||
return GetSecondsSinceEpoch() + TimeManager::GetExternalTimeZoneOffset();
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
struct TimeManager::Impl final {
|
||||
explicit Impl(Core::System& system)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue