CPUTimer
Concrete implementation of the Timer class for CPU-based timing. More...
#include "Utils/Timers.h"
Inherits from Timer
Public Functions
Name | |
---|---|
CPUTimer(std::string name)<br>Constructor. | |
~CPUTimer() override =default<br>Default destructor. | |
virtual double | get()<br>Retrieves the elapsed time for the most recent interval. |
virtual double | getAverage()<br>Retrieves the average time over all measured intervals. |
virtual unsigned int | getCounter() const<br>Retrieves the number of recorded intervals. |
virtual void | reset()<br>Resets the timer, clearing all recorded data. |
virtual void | start(bool sync)<br>Starts the timer. |
virtual void | stop(bool sync)<br>Stops the timer. |
Additional inherited members
Public Functions inherited from Timer
Name | |
---|---|
Timer() =default | |
Timer(double intervalSeconds, sol::protected_function callback, bool oneShot =false) | |
Timer(std::string name)<br>Constructor. | |
virtual | ~Timer() =default<br>Virtual destructor. |
const std::string & | getName() const<br>Retrieves the name of the timer. |
void | tick(double dt) |
Protected Attributes inherited from Timer
Name | |
---|---|
unsigned int | counter <br>Number of recorded intervals. |
std::string | name <br>Name of the timer. |
GLuint64 | previousFrameQueryStart |
double | previousFrameTimeStart <br>Start time of the previous frame. |
GLuint | query <br>OpenGL query object for timing. |
GLuint | queryStart |
GLuint | queryStop <br>OpenGL query objects for timing. |
double | time <br>Time elapsed for the current interval. |
double | timeStart <br>Start time of the current interval. |
double | timeStop <br>Stop time of the current interval. |
double | timeTotal <br>Total accumulated time. |
Friends inherited from Timer
Name | |
---|---|
class | Chronos |
Detailed Description
class CPUTimer;
class CPUTimer;
Concrete implementation of the Timer class for CPU-based timing.
The CPUTimer class measures execution time on the CPU and provides methods to retrieve elapsed and average times.
Public Functions Documentation
function CPUTimer
inline CPUTimer(
std::string name
)
inline CPUTimer(
std::string name
)
Constructor.
Parameters:
- name Name of the timer.
function ~CPUTimer
~CPUTimer() override =default
~CPUTimer() override =default
Default destructor.
function get
inline virtual double get()
inline virtual double get()
Retrieves the elapsed time for the most recent interval.
Return: The elapsed time in seconds.
Reimplements: Timer::get
function getAverage
inline virtual double getAverage()
inline virtual double getAverage()
Retrieves the average time over all measured intervals.
Return: The average time in seconds.
Reimplements: Timer::getAverage
function getCounter
inline virtual unsigned int getCounter() const
inline virtual unsigned int getCounter() const
Retrieves the number of recorded intervals.
Return: The interval count.
Reimplements: Timer::getCounter
function reset
inline virtual void reset()
inline virtual void reset()
Resets the timer, clearing all recorded data.
Reimplements: Timer::reset
function start
inline virtual void start(
bool sync
)
inline virtual void start(
bool sync
)
Starts the timer.
Parameters:
- sync Ignored in this implementation.
Reimplements: Timer::start
function stop
inline virtual void stop(
bool sync
)
inline virtual void stop(
bool sync
)
Stops the timer.
Parameters:
- sync Ignored in this implementation.
Reimplements: Timer::stop
Updated on 2025-05-31 at 12:55:30 +0000