fix: Fixes tick count calculcations (#1366)
This commit is contained in:
parent
0645251ec7
commit
dda55889f6
9 changed files with 23 additions and 35 deletions
|
|
@ -120,6 +120,8 @@ public static class Core
|
|||
|
||||
public static Thread Thread { get; private set; }
|
||||
|
||||
private static long _firstTick;
|
||||
|
||||
[ThreadStatic]
|
||||
private static long _tickCount;
|
||||
|
||||
|
|
@ -164,6 +166,8 @@ public static class Core
|
|||
}
|
||||
}
|
||||
|
||||
public static long Uptime => Thread.CurrentThread != Thread ? 0 : TickCount - _firstTick;
|
||||
|
||||
private static long _cycleIndex = 1;
|
||||
private static float[] _cyclesPerSecond = new float[128];
|
||||
|
||||
|
|
@ -515,6 +519,7 @@ public static class Core
|
|||
|
||||
TcpServer.Start();
|
||||
EventSink.InvokeServerStarted();
|
||||
_firstTick = TickCount;
|
||||
RunEventLoop();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue