Voyager ORB

com.objectspace.lib.timer
Interface IStopwatch

All Known Implementing Classes:
Stopwatch

public abstract interface IStopwatch
extends java.io.Serializable

IStopwatch is the interface implemented by Stopwatch.

Version:
3.0
See Also:
Stopwatch

Fields inherited from class java.io.Serializable
serialVersionUID
 
Method Summary
 double getAverageLapTime()
          Return the average lap time in milliseconds.
 java.util.Date getDate()
          Return the current date.
 int getLapCount()
          Return the current lap count.
 long getLapTime()
          Return the last lap time.
 long[] getLapTimes()
          Return an array of longs that contain the number of milliseconds for each recorded lap or an empty array if lap times were not recorded.
 long getMilliseconds()
          Return the current time as milliseconds since January 1, 1970, 00:00:00 GMT.
 long getTotalTime()
          Return the sum of all the individual lap times in milliseconds.
 boolean isRecordLapTimes()
          Return true if the recording of lap times is enabled.
 void lap()
          Stop the stopwatch to record a lap time and then immediately start the stopwatch again.
 void reset()
          Reset the stopwatch, clear the lap times, and set the lap count to zero.
 void setRecordLapTimes(boolean flag)
          If flag is true, enable the recording of lap times.
 void start()
          Start the stopwatch.
 void stop()
          Stop the stopwatch, increment the lap count, and record the lap time if enabled.
 

Method Detail

getDate

public java.util.Date getDate()
Return the current date.

getMilliseconds

public long getMilliseconds()
Return the current time as milliseconds since January 1, 1970, 00:00:00 GMT.

reset

public void reset()
Reset the stopwatch, clear the lap times, and set the lap count to zero.

start

public void start()
Start the stopwatch.

stop

public void stop()
Stop the stopwatch, increment the lap count, and record the lap time if enabled.

lap

public void lap()
Stop the stopwatch to record a lap time and then immediately start the stopwatch again.

setRecordLapTimes

public void setRecordLapTimes(boolean flag)
If flag is true, enable the recording of lap times.

isRecordLapTimes

public boolean isRecordLapTimes()
Return true if the recording of lap times is enabled.

getLapCount

public int getLapCount()
Return the current lap count.

getLapTime

public long getLapTime()
Return the last lap time.

getLapTimes

public long[] getLapTimes()
Return an array of longs that contain the number of milliseconds for each recorded lap or an empty array if lap times were not recorded.

getTotalTime

public long getTotalTime()
Return the sum of all the individual lap times in milliseconds.

getAverageLapTime

public double getAverageLapTime()
Return the average lap time in milliseconds.

ObjectSpace Inc.

(c) Copyright 1997-1999 ObjectSpace, Inc.
14850 Quorum Drive, Suite 500
Dallas, Texas 75240