Files
dragonpilot/drivers/windows/pandaJ2534DLL Test/Timer.cpp
Vehicle Researcher c251b312d8 Squashed 'panda/' content from commit c371fe6
git-subtree-dir: panda
git-subtree-split: c371fe688dbad4c53635905d3471a01c185e811d
2017-12-23 17:10:42 -08:00

21 lines
456 B
C++

#include "stdafx.h"
#include "Timer.h"
Timer::Timer()
{
reset();
}
// gets the time elapsed from construction.
unsigned long long /*milliseconds*/ Timer::getTimePassed(){
// 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());
}