CTRE Phoenix C++
5.35.1
Loading...
Searching...
No Matches
Stopwatch.h
Go to the documentation of this file.
1
/* Copyright (C) Cross The Road Electronics 2024 */
2
#pragma once
3
4
#include <chrono>
5
#include <cstdint>
6
7
namespace
ctre
{
8
namespace
phoenix {
9
10
/**
11
* Stopwatch to track time in milliseconds
12
*/
13
class
Stopwatch
{
14
public
:
15
/**
16
* Start the stopwatch
17
*/
18
void
Start
();
19
/**
20
* @return Current time elapsed since start in ms
21
*/
22
long
long
int
DurationMs
();
23
/**
24
* @return Current time elapsed since start in s
25
*/
26
double
Duration
();
27
28
private
:
29
std::chrono::steady_clock::time_point _t0 = std::chrono::steady_clock::now();
30
std::chrono::steady_clock::time_point _t1 = std::chrono::steady_clock::now();
31
};
32
33
}}
ctre::phoenix::Stopwatch
Stopwatch to track time in milliseconds.
Definition
Stopwatch.h:13
ctre::phoenix::Stopwatch::Start
void Start()
Start the stopwatch.
ctre::phoenix::Stopwatch::Duration
double Duration()
ctre::phoenix::Stopwatch::DurationMs
long long int DurationMs()
ctre
WPI Compliant CANcoder class.
Definition
CANCoderStatusFrame.h:4
ctre
phoenix
Stopwatch.h
Generated by
1.12.0