Hey guys,
i thought of a way to measure fps.
So, i came up with the following idea:
C# Code:
private void Render()
{
while (renderWin.IsOpen())
{
MeasureFPS();
renderWin.Clear();
renderWin.DispatchEvents();
renderWin.Draw(spPlayer);
renderWin.Draw(txtFps);
renderWin.Display();
}
}
private void MeasureFPS()
{
fps++;
if (DateTime.Now.Subtract(lastTimeMeasured).Seconds > 1)
{
txtFps.DisplayedString = "FPS: " + fps.ToString();
lastTimeMeasured = DateTime.Now;
fps = 0;
}
}
Is this a valid way to determine my fps?
Cause i have about 4000 per second.