Skip to content
Hyomoto edited this page Jun 13, 2021 · 17 revisions
Jump To Go Back Arguments Methods Variables

Timer( *format )

Implements: Struct

Timer provides the difference between two times in your program, when it is started and when it is checked.

:create event
timer = new Timer( "$S second", 2 );

:step event
if ( timer.elapsed() >= 1000000 ) {
  show_debug_message( timer );
	timer.reset()
}
Output: "1 second" is displayed once every second.

Arguments

Name Type Purpose
*format string The display format, $H, $M and $S will be replaced with hours, minutes, and seconds

Methods

Jump To top reset elapsed toString

reset( )

Returns: self

Name Type Purpose
None

Resets the elapsed time to the current moment.


elapsed( )

Returns: int

Name Type Purpose
None

Returns the time elapsed between the start time and now, in microseconds.


toString( )

Returns: string

Name Type Purpose
None

Returns the elapsed time as a formatted StringTime-formatted string.


Variables

Jump To top
Name Type Initial Purpose
__Format string "$S" The format string to use to display the elapsed time
__Start int get_timer() The time at which the timer was started
Clone this wiki locally