diff options
| author | 2021-10-19 09:55:50 -0700 | |
|---|---|---|
| committer | 2021-10-19 09:55:50 -0700 | |
| commit | c871320760ed050168fd74969a6ef9fba3cf535c (patch) | |
| tree | 7127f59acb371f15b80b143ffb0d4bcda28f035e /src/core/hle | |
| parent | Merge pull request #7173 from Morph1984/invalidate-unmap (diff) | |
| parent | settings: Remove std::chrono usage (diff) | |
| download | yuzu-c871320760ed050168fd74969a6ef9fba3cf535c.tar.gz yuzu-c871320760ed050168fd74969a6ef9fba3cf535c.tar.xz yuzu-c871320760ed050168fd74969a6ef9fba3cf535c.zip | |
Merge pull request #7198 from ameerj/settings-chrono
settings: Remove std::chrono usage
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/time/time_manager.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp index 4bbc606a1..9c4c960ef 100644 --- a/src/core/hle/service/time/time_manager.cpp +++ b/src/core/hle/service/time/time_manager.cpp | |||
| @@ -13,18 +13,19 @@ | |||
| 13 | #include "core/hle/service/time/time_manager.h" | 13 | #include "core/hle/service/time/time_manager.h" |
| 14 | 14 | ||
| 15 | namespace Service::Time { | 15 | namespace Service::Time { |
| 16 | 16 | namespace { | |
| 17 | constexpr Clock::TimeSpanType standard_network_clock_accuracy{0x0009356907420000ULL}; | 17 | constexpr Clock::TimeSpanType standard_network_clock_accuracy{0x0009356907420000ULL}; |
| 18 | 18 | ||
| 19 | static std::chrono::seconds GetSecondsSinceEpoch() { | 19 | s64 GetSecondsSinceEpoch() { |
| 20 | return std::chrono::duration_cast<std::chrono::seconds>( | 20 | const auto time_since_epoch = std::chrono::system_clock::now().time_since_epoch(); |
| 21 | std::chrono::system_clock::now().time_since_epoch()) + | 21 | return std::chrono::duration_cast<std::chrono::seconds>(time_since_epoch).count() + |
| 22 | Settings::values.custom_rtc_differential; | 22 | Settings::values.custom_rtc_differential; |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | static s64 GetExternalRtcValue() { | 25 | s64 GetExternalRtcValue() { |
| 26 | return GetSecondsSinceEpoch().count() + TimeManager::GetExternalTimeZoneOffset(); | 26 | return GetSecondsSinceEpoch() + TimeManager::GetExternalTimeZoneOffset(); |
| 27 | } | 27 | } |
| 28 | } // Anonymous namespace | ||
| 28 | 29 | ||
| 29 | struct TimeManager::Impl final { | 30 | struct TimeManager::Impl final { |
| 30 | explicit Impl(Core::System& system) | 31 | explicit Impl(Core::System& system) |