Skip to content

File structs.h

FileList > extra > structs.h

Go to the source code of this file

Common utility structures for timing and performance measurement. More...

  • #include <string>
  • #include <vector>
  • #include <ctime>
  • #include <iostream>

Classes

Type Name
struct AverageTime <_L>
Exponential moving average for smoothing time-series data.
struct Timer
RAII-based timer for profiling code sections.

Detailed Description

This header provides lightweight structures for profiling and performance monitoring during development and runtime. Timers are RAII-based for automatic lifecycle management.

Architecture: * Timer provides scoped timing with automatic reporting * AverageTime implements exponential moving average for smoothing metrics * Debug output conditionally compiled in _DEBUG builds

Design Principles: * RAII for automatic timer start/stop * Minimal overhead in release builds * Flexible output control (print or silent)

Note:

Timer uses std::clock() which measures CPU time, not wall-clock time.

Note:

For GPU profiling, use OpenGL timer queries instead.


The documentation for this class was generated from the following file src/extra/structs.h