haXe API Documentation
Back |
Indexclass haxe.Timer
Available in flash8, neko, js, flash, php, cpp, cs, java
The Timer class allows you to create asynchronous timers on platforms that support events.
- function new(time_ms : Int) : Void
Available in flash8, js, flash, cs, java
- Create a new timer that will run every
time_ms
(in milliseconds). - dynamic function run() : Void
Available in flash8, js, flash, cs, java
- This is the
run()
method that is called when the Timer executes. It can be either overriden in subclasses or directly rebinded with another function-value. - function stop() : Void
Available in flash8, js, flash, cs, java
- Stop the timer definitely.
- static function delay(f : Void -> Void, time_ms : Int) : Timer
Available in flash8, js, flash, cs, java
- This will delay the call to
f
for the given time. f
will only be called once. - static function measure<T>(f : Void -> T, ?pos : PosInfos) : T
- Measure the time it takes to execute the function
f
and trace it. Returns the value returned by f
. - static function stamp() : Float
- Returns the most precise timestamp, in seconds. The value itself might differ depending on platforms, only differences between two values make sense.
Back |
Index