Stopwatch

Kind of class:class
Inherits from:CoreObject
Implements:
Version:03/18/07
Author:Aaron Clinger
Classpath:org.casaframework.time.Stopwatch
File last modified:Monday, 19 March 2007, 08:53:15
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 destroy() before deleting last object pointer.
#

getTime

function getTime (
) : Number
Gets the time elapsed since start or until stop was called.
Returns:
Returns the elapsed time in milliseconds.
Usage note:
Can be called before or after calling stop.

resume

function resume (
) : Void
Resumes stopwatch from stop.

start

function start (
) : Void
Starts stopwatch and resets previous elapsed time.

stop

function stop (
) : Void
Stops stopwatch.