TickBasedSteadyClockCore.cs 663 B

123456789101112131415161718192021222324
  1. using Ryujinx.Cpu;
  2. namespace Ryujinx.HLE.HOS.Services.Time.Clock
  3. {
  4. class TickBasedSteadyClockCore : SteadyClockCore
  5. {
  6. public TickBasedSteadyClockCore() {}
  7. public override SteadyClockTimePoint GetTimePoint(ITickSource tickSource)
  8. {
  9. SteadyClockTimePoint result = new SteadyClockTimePoint
  10. {
  11. TimePoint = 0,
  12. ClockSourceId = GetClockSourceId()
  13. };
  14. TimeSpanType ticksTimeSpan = TimeSpanType.FromTicks(tickSource.Counter, tickSource.Frequency);
  15. result.TimePoint = ticksTimeSpan.ToSeconds();
  16. return result;
  17. }
  18. }
  19. }