2022-05-31 19:29:35 +00:00
|
|
|
|
using Ryujinx.Cpu;
|
2019-07-25 14:44:51 +00:00
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Time.Clock
|
|
|
|
|
{
|
|
|
|
|
class TickBasedSteadyClockCore : SteadyClockCore
|
|
|
|
|
{
|
2019-10-08 03:48:49 +00:00
|
|
|
|
public TickBasedSteadyClockCore() {}
|
2019-07-25 14:44:51 +00:00
|
|
|
|
|
2022-05-31 19:29:35 +00:00
|
|
|
|
public override SteadyClockTimePoint GetTimePoint(ITickSource tickSource)
|
2019-07-25 14:44:51 +00:00
|
|
|
|
{
|
|
|
|
|
SteadyClockTimePoint result = new SteadyClockTimePoint
|
|
|
|
|
{
|
|
|
|
|
TimePoint = 0,
|
|
|
|
|
ClockSourceId = GetClockSourceId()
|
|
|
|
|
};
|
|
|
|
|
|
2022-05-31 19:29:35 +00:00
|
|
|
|
TimeSpanType ticksTimeSpan = TimeSpanType.FromTicks(tickSource.Counter, tickSource.Frequency);
|
2019-07-25 14:44:51 +00:00
|
|
|
|
|
|
|
|
|
result.TimePoint = ticksTimeSpan.ToSeconds();
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|