Loading...
Searching...
No Matches
juce::TimedDiagnostic Class Reference

Detailed Description

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.


The documentation for this class was generated from the following file:

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.
TimedDiagnosticoperator+= (TimedDiagnostic other)
 Adds another diagnostic's stored duration to this one.
TimedDiagnosticoperator-= (TimedDiagnostic other)
 Subtracts another diagnostic's stored duration from this one.
ScopedTimeMeasurement createTimer () &&=delete

Member Functions

◆ get()

template<typename TimeUnit>
auto juce::TimedDiagnostic::get ( ) const
inline

Returns the stored duration, converted to the requested time unit, as a numeric value.

For example:

◆ set()

template<typename TimeUnit>
void juce::TimedDiagnostic::set ( const TimeUnit & newValue)
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.

◆ createTimer() [1/2]

ScopedTimeMeasurement juce::TimedDiagnostic::createTimer ( ) &
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.

◆ isEmpty()

bool juce::TimedDiagnostic::isEmpty ( ) const
inline

Returns true if this diagnostic does not currently store any measured time.

References juce::exactlyEqual().

◆ operator+()

TimedDiagnostic juce::TimedDiagnostic::operator+ ( TimedDiagnostic other) const
inline

Returns the sum of this diagnostic and another diagnostic.

◆ operator-()

TimedDiagnostic juce::TimedDiagnostic::operator- ( TimedDiagnostic other) const
inline

Returns the difference between this diagnostic and another diagnostic.

◆ operator+=()

TimedDiagnostic & juce::TimedDiagnostic::operator+= ( TimedDiagnostic other)
inline

Adds another diagnostic's stored duration to this one.

◆ operator-=()

TimedDiagnostic & juce::TimedDiagnostic::operator-= ( TimedDiagnostic other)
inline

Subtracts another diagnostic's stored duration from this one.

◆ createTimer() [2/2]

ScopedTimeMeasurement juce::TimedDiagnostic::createTimer ( ) &&
delete
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram