I am trying to use time() to measure various points of my program.
What I don\'t understand is why the values in the before and after are the same? I understand thi
You can use SFML library, which is Simple and Fast Multimedia Library. It includes many useful and well-defined classes like Clock, Socket, Sound, Graphics, etc. It's so easy to use and highly recommended.
This is an example for this question.
sf::Clock clock;
...
Time time1 = clock.getElapsedTime();
...
Time time2 = clock.restart();