public void Dispose() { StowatchUpdate.Stop(); StowatchUpdate = default; StowatchFrame.Stop(); StowatchFrame = default; }
public void StopFrame() { StowatchFrame.Stop(); Elapsed += StowatchFrame.Elapsed; FrameCount++; var updateElapsed = StowatchUpdate.Elapsed; if (updateElapsed >= UpdateRate) { FpsRender = FrameCount / Elapsed.TotalSeconds; FpsGlobal = FrameCount / updateElapsed.TotalSeconds; StowatchUpdate.Restart(); Elapsed = TimeSpan.Zero; FrameCount = 0; } }