A class with static methods for dealing with named timers.
suntest.javastar.lib.JSTimer
java.lang.Object
 suntest.javastar.lib.JSTimer
public class JSTimer
extends Object
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). |
public static long getElapsedTime(String name)
Returns the current elapsed time on the timer by the given name. If the timer is not already started, then -1 will be returned.
public static long getStartTime(String name)
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)
.
public static void register(JSTimerCallback object, boolean negatives)
Registers to receive callbacks.
public static long start(String name)
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).
public static long stop(String name)
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.
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.