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:

- juce_core/time/juce_TimedDiagnostic.h

## 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

## 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:

- get<Milliseconds>() returns the stored duration expressed in milliseconds
- get<Microseconds>() returns the stored duration expressed in microseconds

## 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

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited