An object for storing and measuring durations for diagnostic purposes.
This object is designed to have minimal performance impact so that it doesn't distort results and is safe to use even in real-time audio contexts.
Public Member Functions | |
| template<typename TimeUnit> | |
| auto | get () const |
| Returns the stored duration, converted to the requested time unit, as a numeric value. | |
| template<typename TimeUnit> | |
| void | set (const TimeUnit &newValue) |
| Sets the stored duration from the given value. | |
| ScopedTimeMeasurement | createTimer () & |
| Creates a scoped timer that stores the elapsed time in this diagnostic. | |
| bool | isEmpty () const |
| Returns true if this diagnostic does not currently store any measured time. | |
| TimedDiagnostic | operator+ (TimedDiagnostic other) const |
| Returns the sum of this diagnostic and another diagnostic. | |
| TimedDiagnostic | operator- (TimedDiagnostic other) const |
| Returns the difference between this diagnostic and another diagnostic. | |
| TimedDiagnostic & | operator+= (TimedDiagnostic other) |
| Adds another diagnostic's stored duration to this one. | |
| TimedDiagnostic & | operator-= (TimedDiagnostic other) |
| Subtracts another diagnostic's stored duration from this one. | |
| ScopedTimeMeasurement | createTimer () &&=delete |
|
inline |
Returns the stored duration, converted to the requested time unit, as a numeric value.
For example:
|
inline |
Sets the stored duration from the given value.
The provided duration may be expressed in any time unit, such as Seconds, Milliseconds, or Microseconds.
|
inline |
Creates a scoped timer that stores the elapsed time in this diagnostic.
The returned object measures the time between its construction and destruction, and sets that elapsed duration to this TimedDiagnostic.
|
inline |
Returns true if this diagnostic does not currently store any measured time.
References juce::exactlyEqual().
|
inline |
Returns the sum of this diagnostic and another diagnostic.
|
inline |
Returns the difference between this diagnostic and another diagnostic.
|
inline |
Adds another diagnostic's stored duration to this one.
|
inline |
Subtracts another diagnostic's stored duration from this one.
|
delete |