SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::Benchmark Class Reference

#include <Benchmark.hpp>

Public Member Functions

 Benchmark ()=default
 ~Benchmark ()
void Initialize (RenderEngine::Renderer *renderer)
bool IsRecording () const
void RegisterMetric (const std::string &name, std::function< float()> getter)
 Register a custom metric (e.g. render distance from Game).
void Tick (float deltaTime)
 Call once per frame from the main loop.
void ToggleRecording ()
 Toggle recording on/off (F12).
void UnregisterMetric (const std::string &name)

Detailed Description

Records per-frame performance data to a CSV session file while recording is active.

Definition at line 23 of file Benchmark.hpp.

Constructor & Destructor Documentation

◆ Benchmark()

Sleak::Benchmark::Benchmark ( )
default

◆ ~Benchmark()

Benchmark::~Benchmark ( )

Definition at line 24 of file Benchmark.cpp.

Member Function Documentation

◆ Initialize()

void Benchmark::Initialize ( RenderEngine::Renderer * renderer)

Definition at line 29 of file Benchmark.cpp.

◆ IsRecording()

bool Sleak::Benchmark::IsRecording ( ) const
inline

Definition at line 39 of file Benchmark.hpp.

◆ RegisterMetric()

void Benchmark::RegisterMetric ( const std::string & name,
std::function< float()> getter )

Register a custom metric (e.g. render distance from Game).

Definition at line 33 of file Benchmark.cpp.

◆ Tick()

void Benchmark::Tick ( float deltaTime)

Call once per frame from the main loop.

Definition at line 50 of file Benchmark.cpp.

◆ ToggleRecording()

void Benchmark::ToggleRecording ( )

Toggle recording on/off (F12).

Definition at line 55 of file Benchmark.cpp.

◆ UnregisterMetric()

void Benchmark::UnregisterMetric ( const std::string & name)

Definition at line 43 of file Benchmark.cpp.