|
@@ -54,30 +54,36 @@ class Stopwatch {
|
54
|
54
|
FORCE_INLINE static void init() { reset(); }
|
55
|
55
|
|
56
|
56
|
/**
|
57
|
|
- * @brief Stops the stopwatch
|
58
|
|
- * @details Stops the running timer, it will silently ignore the request if
|
59
|
|
- * no timer is currently running.
|
60
|
|
- * @return true is method was successful
|
|
57
|
+ * @brief Stop the stopwatch
|
|
58
|
+ * @details Stop the running timer, it will silently ignore the request if
|
|
59
|
+ * no timer is currently running.
|
|
60
|
+ * @return true on success
|
61
|
61
|
*/
|
62
|
62
|
static bool stop();
|
63
|
63
|
|
64
|
64
|
/**
|
65
|
65
|
* @brief Pause the stopwatch
|
66
|
66
|
* @details Pause the running timer, it will silently ignore the request if
|
67
|
|
- * no timer is currently running.
|
68
|
|
- * @return true is method was successful
|
|
67
|
+ * no timer is currently running.
|
|
68
|
+ * @return true on success
|
69
|
69
|
*/
|
70
|
70
|
static bool pause();
|
71
|
71
|
|
72
|
72
|
/**
|
73
|
73
|
* @brief Start the stopwatch
|
74
|
74
|
* @details Start the timer, it will silently ignore the request if the
|
75
|
|
- * timer is already running.
|
76
|
|
- * @return true is method was successful
|
|
75
|
+ * timer is already running.
|
|
76
|
+ * @return true on success
|
77
|
77
|
*/
|
78
|
78
|
static bool start();
|
79
|
79
|
|
80
|
80
|
/**
|
|
81
|
+ * @brief Resume the stopwatch
|
|
82
|
+ * @details Resume a timer from a given duration
|
|
83
|
+ */
|
|
84
|
+ static void resume(const millis_t duration);
|
|
85
|
+
|
|
86
|
+ /**
|
81
|
87
|
* @brief Reset the stopwatch
|
82
|
88
|
* @details Reset all settings to their default values.
|
83
|
89
|
*/
|
|
@@ -88,14 +94,14 @@ class Stopwatch {
|
88
|
94
|
* @details Return true if the timer is currently running, false otherwise.
|
89
|
95
|
* @return true if stopwatch is running
|
90
|
96
|
*/
|
91
|
|
- static bool isRunning();
|
|
97
|
+ FORCE_INLINE static bool isRunning() { return state == RUNNING; }
|
92
|
98
|
|
93
|
99
|
/**
|
94
|
100
|
* @brief Check if the timer is paused
|
95
|
101
|
* @details Return true if the timer is currently paused, false otherwise.
|
96
|
102
|
* @return true if stopwatch is paused
|
97
|
103
|
*/
|
98
|
|
- static bool isPaused();
|
|
104
|
+ FORCE_INLINE static bool isPaused() { return state == PAUSED; }
|
99
|
105
|
|
100
|
106
|
/**
|
101
|
107
|
* @brief Get the running time
|