sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
class SGXTimer;
part of SGEXTN module SG_Core
timer for delayed and repeated execution of functions
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGXTimer.h›
CMake target for BuildLah: SGEXTN::SG_Core
see this link for more information about BuildLah
parent class: (none)
children classes: (none)
void (*attachedFunction)();
SGXTimer(float t, void (*attachedFunction)());
void deleteTimer();
void start() const;
void stop() const;
static void singleCall(float t, void (*attachedFunction)());
SGXTimer provides a timer that takes a callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ which can be either run after a specified amount of time have passed or be run at a regular interval.
wrapper of QTimer
callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ attached to this SGXTimer.
This is set automatically by the constructor. Only set it explicitly if you want to change the callback function ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾ attached to an ongoing SGXTimer.
Setting this to nullptr is undefined behaviour. Use SGXTimer::stop if you want to stop an ongoing SGXTimer.
Creates and starts a SGXTimer running attachedFunction every t seconds.
Pass 0 to t to run attachedFunction on every frame, this may significantly increase power consumption of your application.
The timer is automatically started upon creation.
attachedFunction being nullptr will crash.
t being negative will crash.
Directly deleting a SGXTimer will crash as not preventing it would lead to a use after free bug.
Deletes the SGXTimer safely.
Directly deleting a SGXTimer will crash as not preventing it would lead to a use after free bug.
Restarts this SGXTimer which is previously paused.
If this SGXTimer was not previously paused, this restarts the time.
Pauses this SGXTimer. The timer can be resumed using SGXTimer::start later.
Restarting a SGXTimer using SGXTimer::start resets the time.
Runs attachedFunction after t seconds once without repeating it.
Pass 0 to t to run attachedFunction immediately after this frame.
The SGXTimer object controlling this is not exposed, so you cannot stop or restart this timer.
attachedFunction being nullptr will crash.
t being negative will crash.
©2025 05524F.sg (Singapore)