Gin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
A simple RAII-based time profiler for measuring execution duration.
Definition utilities/gin_util.h:277

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: