Stopwatch
| Kind of class: | class |
|---|---|
| Inherits from: | CoreObject |
| Implements: | |
| Known subclasses: | |
| Version: | 06/11/07 |
| Author: | Aaron Clinger |
| Classpath: | org.casaframework.time.Stopwatch |
| File last modified: | Sunday, 19 August 2007, 13:43:33 |
Simple stopwatch class that records elapsed time in milliseconds.
Example:
var stopwatch:Stopwatch = new Stopwatch(); this.start_mc.onPress = function():Void { this._parent.stopwatch.start(); trace("Stopwatch started."); } this.stop_mc.onPress = function():Void { this._parent.stopwatch.stop(); trace("Stopwatch stopped. Time elapsed: " + this._parent.stopwatch.getTime()); } this.resume_mc.onPress = function():Void { this._parent.stopwatch.resume(); trace("Stopwatch continued."); }
Summary
Constructor
Instance properties
Instance properties inherited from CoreObject
Instance methods
Instance methods inherited from CoreObject
Constructor
Stopwatch
function Stopwatch ()
Instance methods
destroy
function destroy () : Void
Removes any internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.
Always call
#Always call
destroy() before deleting last object pointer.Specified by:
getTime
function getTime () : Number
Returns:
Returns the elapsed time in milliseconds.
Usage note:
Can be called before or after calling stop.
start
function start () : Void
Starts stopwatch and resets previous elapsed time.
Specified by:
stop
function stop () : Void
Stops stopwatch.
Specified by: