Skip to content

Commit 50c59ef

Browse files
committed
docs: improve timing related docs
1 parent cd65f98 commit 50c59ef

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

libClearCore/inc/SysTimer.h

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ namespace ClearCore {
3434

3535
/**
3636
\class SysTimer
37-
\brief ClearCore system timer/stopwatch class
37+
\brief Abstract stopwatch/timer base (Start/Elapsed/Completed) with selectable time base.
3838
39-
This class provides generic timer functionality that can be inherited to
40-
use different time bases
39+
<b>Use this when:</b> you want a stopwatch object (start, delay, completed, elapsed) and you’ll choose the time base via a derived class.
40+
41+
<b>Pick a derived class:</b>
42+
- SysTimerMs for millisecond-scale delays
43+
- SysTimerUs for microsecond-scale delays.
4144
**/
4245
class SysTimer {
4346

@@ -135,7 +138,13 @@ class SysTimer {
135138

136139
/**
137140
\class SysTimerMs
138-
\brief ClearCore system timer/stopwatch class using millisecond time base
141+
\brief Stopwatch/timer using millisecond time base (recommended for most timeouts).
142+
143+
<b>Use this when:</b> your delays/timeouts are human-scale (10 ms to minutes+), and you don’t need microsecond resolution.
144+
145+
<b>Time base:</b> milliseconds.
146+
147+
<b>Rollover guidance:</b> this timer will rollover every ~49.7 days - safe for long-running timers compared to microseconds (microsecond base rolls faster).
139148
**/
140149
class SysTimerMs : public SysTimer {
141150

@@ -168,7 +177,13 @@ class SysTimerMs : public SysTimer {
168177

169178
/**
170179
\class SysTimerUs
171-
\brief ClearCore system timer/stopwatch class using microsecond time base
180+
\brief Stopwatch/timer using microsecond time base (short, high-resolution timing).
181+
182+
<b>Use this when:</b> you need short, tight timing (sub-millisecond delays, pulse measurement windows, quick debounces).
183+
184+
<b>Time base:</b> microseconds.
185+
186+
<b>Rollover caution:</b> this timer will rollover every ~71.5 minutes - best for shorter, more precise intervals.
172187
**/
173188
class SysTimerUs : public SysTimer {
174189

libClearCore/inc/SysTiming.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ const uint16_t SampleRateHz = _CLEARCORE_SAMPLE_RATE_HZ;
8080

8181
/**
8282
\class SysTiming
83-
\brief ClearCore system timing class
83+
\brief System time counters (global uptime-style milliseconds/microseconds).
8484
85-
This class provides an interface for various timing-related operations.
85+
<b>Use this when:</b> you want a global time reference (uptime-style counters) without creating timer objects.
8686
**/
8787
class SysTiming {
8888
friend class SysManager;

0 commit comments

Comments
 (0)