Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: understand sf::Time  (Read 2097 times)

0 Members and 1 Guest are viewing this topic.


  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
understand sf::Time
« on: April 11, 2021, 02:07:12 am »

does sf::Time stores an static point of time from clock or it is constantly taking the time from clock?...


sf::Clock clk;
//do some things
sf::Time t0 = clk.getElapsedTime();             //N0
//... do some other things that take a while
std::cout << t0.asSeconds();                       //N1

N0: lets suppose here the time is 0.002

N1: does t0 is the same time point as before or it will print a later value?.. for instance 0.01

Oh yeah!!.. i have tried it on my own... but stdout prints an e+10 very large number...
« Last Edit: April 11, 2021, 02:08:52 am by digimikeh »


  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: understand sf::Time
« Reply #1 on: April 11, 2021, 04:29:36 pm »
sf::Time is simply a value. It doesn't change on its own.

Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: