Timer Classes: JSTimer


A class with static methods for dealing with named timers.

Class

Inheritance

Syntax

Methods

suntest.javastar.lib.JSTimer Methods

Method Description
getElapsedTime(String) Returns the current elapsed time on the timer by the given name (represented by String).
getStartTime(String) Returns the current start time on the timer by the given name (represented by String).
register(Object, Boolean) Registers to receive callbacks.
start(String) Starts a timer by the given name (represented by String).
stop(String) Stops a timer by the given name (represented by String).

getElapsedTime(String)

Syntax

Description

Returns the current elapsed time on the timer by the given name. If the timer is not already started, then -1 will be returned.

Parameters

getStartTime(String)

Syntax

Description

Returns the current start time on the timer by the given name. If the timer is not already started, then -1 will be returned. Start time is the value of System.currentTimeMillis() at the last call to JSTimer.start(name).

Parameters

register(Object, Boolean)

Syntax

Description

Registers to receive callbacks.

Parameters

start(String)

Syntax

Description

Starts a timer by the given name. Normally returns -1. If the timer is already started, then it will be stopped and restarted, and the elapsed time will be returned (and reported).

Parameters

stop(String)

Syntax

Description

Stops a timer by the given name. Normally returns (and reports) the elapsed time (in ms) since it was started. If the timer is not already started, then -1 will be returned.

Parameters




Send feedback to JavaStar-feedback@suntest.com
Copyright © 1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303. All rights reserved.