Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
HighResTimer.cs
1using System.Diagnostics;
2
3namespace Gondwana.Timers;
4
11public static class HighResTimer
12{
16 public static long TicksPerSecond => Stopwatch.Frequency;
17
21 public static bool HighPerfSupported => Stopwatch.IsHighResolution;
22
27 public static long GetCurrentTick() => Stopwatch.GetTimestamp();
28
35 public static float GetDuration(long start, long stop) => (float)(stop - start) / TicksPerSecond;
36
42 public static float GetElapsedSince(long start) => GetDuration(start, GetCurrentTick());
43}