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

17 lines
421 B
C++
Raw Normal View History

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