1
0
Fork 0

Adding Spectre/System/Stopwatch

This commit is contained in:
Henrik Hautakoski 2020-12-14 19:09:17 +01:00
parent 919aa7740a
commit f62373dcbc
3 changed files with 54 additions and 1 deletions

View file

@ -0,0 +1,27 @@
#ifndef SPECTRE_SYSTEM_STOPWATCH_H
#define SPECTRE_SYSTEM_STOPWATCH_H
#include <Spectre/Math/Time.h>
namespace sp {
class Stopwatch {
public :
Stopwatch();
// Restart the watch. also returns the elapsed time before
// the watch was restarted.
Time restart();
// Get the elapsed time since the watch was restarted.
Time elapsed() const;
private :
Time m_start;
};
} // namespace sp
#endif /* SPECTRE_SYSTEM_STOPWATCH_H */