summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/time/standard_network_system_clock_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/service/time/standard_network_system_clock_core.h')
-rw-r--r--src/core/hle/service/time/standard_network_system_clock_core.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/hle/service/time/standard_network_system_clock_core.h b/src/core/hle/service/time/standard_network_system_clock_core.h
index 467285160..3f505c37c 100644
--- a/src/core/hle/service/time/standard_network_system_clock_core.h
+++ b/src/core/hle/service/time/standard_network_system_clock_core.h
@@ -8,6 +8,10 @@
#include "core/hle/service/time/steady_clock_core.h"
#include "core/hle/service/time/system_clock_core.h"
+namespace Core {
+class System;
+}
+
namespace Service::Time::Clock {
class StandardNetworkSystemClockCore final : public SystemClockCore {
@@ -19,6 +23,22 @@ public:
standard_network_clock_sufficient_accuracy = value;
}
+ bool IsStandardNetworkSystemClockAccuracySufficient(Core::System& system) {
+ SystemClockContext context{};
+ if (GetClockContext(system, context) != RESULT_SUCCESS) {
+ return {};
+ }
+
+ s64 span{};
+ if (context.steady_time_point.GetSpanBetween(
+ GetSteadyClockCore().GetCurrentTimePoint(system), span) != RESULT_SUCCESS) {
+ return {};
+ }
+
+ return TimeSpanType{span}.nanoseconds <
+ standard_network_clock_sufficient_accuracy.nanoseconds;
+ }
+
private:
TimeSpanType standard_network_clock_sufficient_accuracy{};
};