SFML community forums
Help => System => Topic started by: Chi on March 15, 2013, 11:54:39 pm
-
Hello all,
sf::Clock clock;
sf::Time time;
time = clock.getElapsedTime();
std::cout << time.asSeconds() << std::endl;
if i put line 3 and 4 in the Game Loop, its shows seconds. But if put it before the Game loop starts, it gives me a 1e-006. Why that happens?
-
If you do some math, you will see that this is a very small number. The reason it isn't 0 is because time IS passing as soon as the clock is created, and that number you see is that amount.
-
Oh - you are right. I never thinked its a small number ;D
thanks !
-
That would be called scientific notation my friend look it up and it might help abit