Class: profile_timer
Lightweight script profile timer.
Since
OpenXRay 2025-03-19, ac4ba75d, PR #1771
Source
C++ class profile_timer
Custom Constructor
profile_timer
Remarks
The timer accumulates elapsed microseconds between matching start() and stop() calls. Nested starts are counted and only the outermost stop adds elapsed time.
Extends
Constructors
Constructor
new profile_timer(): profile_timer;Create a stopped profile timer.
Returns
profile_timer
Overrides
Constructor
new profile_timer(timer: profile_timer): profile_timer;Copy an existing timer.
Parameters
| Parameter | Type | Description |
|---|---|---|
timer | profile_timer | Timer to copy. |
Returns
profile_timer
Overrides
EngineBinding.constructorMethods
start()
start(): void;Start or restart measuring elapsed time.
Returns
void
Remarks
Calling start() while the timer is already running increases the recursion mark instead of restarting the underlying clock.
stop()
stop(): void;Stop measuring elapsed time.
Returns
void
Remarks
Calling stop() on a timer that was not started is ignored.
time()
time(): number;Returns
number
Elapsed time in microseconds.
toString()
toString(): string;Overridden string cast is implemented for profiling timer.
Returns
string
Serialized profile time.
Properties
__name
readonly __name: string;LuaBind instance constructor name.
Inherited from
__name
readonly static __name: string;LuaBind class constructor name.