This commit is contained in:
nastys
2019-07-30 13:48:28 +02:00
parent 17b6c02aee
commit d1349cfebe
157 changed files with 0 additions and 0 deletions
@@ -0,0 +1,36 @@
#include "Stopwatch.h"
namespace TLAC::Utilities
{
Stopwatch::Stopwatch()
{
}
Stopwatch::~Stopwatch()
{
}
void Stopwatch::Start()
{
start = high_resolution_clock::now();
}
float Stopwatch::Stop()
{
end = high_resolution_clock::now();
return GetElapsed();
}
float Stopwatch::Restart()
{
float elapsed = Stop();
Start();
return elapsed;
}
float Stopwatch::GetElapsed()
{
return (float)(chrono::duration_cast<std::chrono::microseconds>(end - start).count() / TIME_FACTOR);
}
}