Kemena3D
Loading...
Searching...
No Matches
kemena::kTimer Class Reference

Measures elapsed time between consecutive frames. More...

#include <ktimer.h>

Public Member Functions

 kTimer ()
 Constructs the timer and initialises its internal reference timestamp.
void tick ()
 Records the current time and computes the delta since the last tick.
float getDeltaTime ()
 Returns the elapsed time (in seconds) between the last two tick() calls.

Detailed Description

Measures elapsed time between consecutive frames.

Call tick() once per frame (before reading getDeltaTime()) to update the stored delta-time value.

Constructor & Destructor Documentation

◆ kTimer()

kemena::kTimer::kTimer ( )

Constructs the timer and initialises its internal reference timestamp.

Member Function Documentation

◆ getDeltaTime()

float kemena::kTimer::getDeltaTime ( )

Returns the elapsed time (in seconds) between the last two tick() calls.

Returns
Delta time in seconds.

◆ tick()

void kemena::kTimer::tick ( )

Records the current time and computes the delta since the last tick.

Must be called once per frame before getDeltaTime().


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