Why do people always convert
sf::Time objects immediately to
float (or even worse,
double)? The idea behind the
sf::Time class is to have a unique and type-safe way to refer to time spans in SFML. As it overloads all the necessary operators, there is no need for conversions. Only do so if you really need the
float value, for example to multiply the time with a velocity.
By the way, I would rename
updateTimer to
updateTime (or even clearer:
interval or
frameDuration or similar).
float delta = 0.f;
int updates = 0;
//in loop
sf::Time now = clock.getElapsedTime();
delta += (now - time) / updateTime;