1

How can i get frames per second using delta time.

Here's my code that return delta time

auto const old = last;
last = steady_clock::now();
const duration<float> frameTime = last - old;
return frameTime.count();

enter image description here

TestoHirvi
  • 11
  • 2

1 Answers1

2

Suppose your delta time is in milliseconds, then fps (frames per second) is calculate as fps = 1000 / delta_time.

vaizq
  • 33
  • 6