blob: 522965b732eaf1061ac3f255d5e813afe155eb56 [file] [log] [blame]
Brian Silverman890a32a2018-03-11 15:41:56 -07001#include "ctre/phoenix/Stopwatch.h"
2
3namespace ctre {
4namespace phoenix {
5
6void Stopwatch::Start(){
7 _t0 = (float)clock();
8}
9unsigned int Stopwatch::DurationMs(){
10 return Stopwatch::Duration() * 1000;
11}
12float Stopwatch::Duration(){
13 _t1 = (float)clock();
14 long retval = _t1 - _t0;
15 if(retval < 0) retval = 0;
16 return retval * _scalar;
17}
18
19} // namespace phoenix
20}