Files
panda-meb/drivers/windows/pandaJ2534DLL Test/Timer.cpp

21 lines
456 B
C++
Raw Normal View History

2017-09-14 18:01:06 -07:00
#include "stdafx.h"
#include "Timer.h"
Timer::Timer()
{
reset();
2017-09-14 18:01:06 -07:00
}
// gets the time elapsed from construction.
2017-10-11 03:33:25 -07:00
unsigned long long /*milliseconds*/ Timer::getTimePassed(){
2017-09-14 18:01:06 -07:00
// get the new time
auto end = std::chrono::time_point_cast<std::chrono::milliseconds>(clock::now());
// return the difference of the times
return (end - start).count();
}
void Timer::reset() {
start = std::chrono::time_point_cast<std::chrono::milliseconds>(clock::now());
2017-09-14 18:01:06 -07:00
}