Esempio n. 1
0
        public void Dispose()
        {
            StowatchUpdate.Stop();
            StowatchUpdate = default;

            StowatchFrame.Stop();
            StowatchFrame = default;
        }
Esempio n. 2
0
        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;
            }
        }