Gin
Loading...
Searching...
No Matches
TimeProfiler Class Reference

A simple RAII-based time profiler for measuring execution duration. More...

#include <gin_util.h>

Public Member Functions

 TimeProfiler (const juce::String &name_)
 Creates a TimeProfiler with the specified name.
 ~TimeProfiler ()
 Destructor that outputs the elapsed time to the debug console.

Detailed Description

A simple RAII-based time profiler for measuring execution duration.

Create an instance at the start of a scope to measure how long that scope takes to execute. When the instance is destroyed, it prints the elapsed time to the debug console.

Example usage:

{
TimeProfiler timer ("MyFunction");
// ... code to profile ...
} // Prints "MyFunction 1.23s" to debug output
TimeProfiler(const juce::String &name_)
Creates a TimeProfiler with the specified name.
Definition utilities/gin_util.h:283

Constructor & Destructor Documentation

◆ TimeProfiler()

TimeProfiler::TimeProfiler ( const juce::String & name_)

Creates a TimeProfiler with the specified name.

Parameters
name_The name to display in the debug output

◆ ~TimeProfiler()

TimeProfiler::~TimeProfiler ( )

Destructor that outputs the elapsed time to the debug console.


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