mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-05 13:32:05 +08:00
c251b312d8
git-subtree-dir: panda git-subtree-split: c371fe688dbad4c53635905d3471a01c185e811d
17 lines
421 B
C++
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();
|
|
} |