Please could me someone explain to me how does work this calculation? this formula works (its derivation)? I do not get it :(
framerate = (1 / gameTime.ElapsedGameTime.TotalSeconds);
From documentation I read that gameTime.ElapsedGameTime.TotalSeconds should return value Time since the last call to Microsoft.Xna.Framework.Game.Update(Microsoft.Xna.Framework.GameTime)
wouldn't we want time since the last call to Draw() method?
Share Edit Undelete Flag
You can actually also use "gameTime.ElapsedGameTime.TotalSeconds" in the Draw() method.
"gameTime.ElapsedGameTime.TotalSeconds" return the delta time since the last draw call. So dividing 1 by the delta time returns some kind of a frequency.
Our framerate is the "frequency" (f) and our delta time is the "period"(T).