SFML community forums

Help => System => Topic started by: Chi on March 15, 2013, 11:54:39 pm

Title: Time.aSeconds returns 1e-006 ?
Post by: Chi on March 15, 2013, 11:54:39 pm
Hello all,

Quote from: cpp
        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?
Title: Re: Time.aSeconds returns 1e-006 ?
Post by: Jebbs on March 16, 2013, 12:19:48 am
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.
Title: Re: Time.aSeconds returns 1e-006 ?
Post by: Chi on March 16, 2013, 12:41:29 am
Oh - you are right. I never thinked its a small number  ;D

thanks !
Title: Re: Time.aSeconds returns 1e-006 ?
Post by: Sauce. on May 22, 2013, 03:30:10 am
That would be called scientific notation my friend look it up and it might help abit