Files
dragonpilot/drivers/windows/pandaJ2534DLL/Timer.cpp
Vehicle Researcher dba8e01e54 Squashed 'panda/' content from commit ae816c104
git-subtree-dir: panda
git-subtree-split: ae816c104a99a8cd4d508ccd6abdc7b93053529c
2019-06-28 21:09:12 +00:00

17 lines
421 B
C++

#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.
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();
}