2019-12-22 23:49:51 +01:00
|
|
|
// Copyright 2020 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "core/core.h"
|
|
|
|
#include "core/core_timing.h"
|
2020-02-12 00:56:24 +01:00
|
|
|
#include "core/hardware_properties.h"
|
2019-12-22 23:49:51 +01:00
|
|
|
#include "core/hle/service/time/tick_based_steady_clock_core.h"
|
|
|
|
|
|
|
|
namespace Service::Time::Clock {
|
|
|
|
|
|
|
|
SteadyClockTimePoint TickBasedSteadyClockCore::GetTimePoint(Core::System& system) {
|
2020-02-25 03:04:12 +01:00
|
|
|
const TimeSpanType ticks_time_span{
|
|
|
|
TimeSpanType::FromTicks(system.CoreTiming().GetClockTicks(), Core::Hardware::CNTFREQ)};
|
2019-12-22 23:49:51 +01:00
|
|
|
|
|
|
|
return {ticks_time_span.ToSeconds(), GetClockSourceId()};
|
|
|
|
}
|
|
|
|
|
|
|
|
TimeSpanType TickBasedSteadyClockCore::GetCurrentRawTimePoint(Core::System& system) {
|
|
|
|
return TimeSpanType::FromSeconds(GetTimePoint(system).time_point);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Service::Time::Clock
|