private void Update() { TimeLeft -= Time.deltaTime; Accum += Time.timeScale / Time.deltaTime; ++Frames; if (TimeLeft <= 0) { FPSText.text = "Frame rate: " + (Accum / Frames).ToString("f2"); TimeLeft = UpdateInterval; Accum = 0.0f; Frames = 0; } }
protected override void Draw(GameTime gameTime) { _frameRate.Update((float)gameTime.ElapsedGameTime.TotalSeconds); SetWindowTitle($"{Math.Round(_frameRate.AverageFramesPerSecond)} fps"); ScreenManager.Draw(); base.Draw(gameTime); }