de.uplanet.util
Class Stopwatch

java.lang.Object
  extended by de.uplanet.util.Stopwatch

@Scriptable
public final class Stopwatch
extends java.lang.Object

Stopwatch with millisecond time resolution.

Version:
$Revision: 75089 $

Field Summary
static long MICROS
           
static long MILLIS
           
static long NANOS
           
 
Constructor Summary
Stopwatch()
          Create a stopwatch with millisecond resolution.
Stopwatch(long p_lResolution)
          Create a stopwatch with a given resolution.
 
Method Summary
 long restart()
          Get the meantime in milliseconds and reset to zero.
 void start()
          Start the stopwatch.
 long stop()
          Get the meantime in milliseconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MILLIS

public static final long MILLIS
See Also:
Constant Field Values

MICROS

public static final long MICROS
See Also:
Constant Field Values

NANOS

public static final long NANOS
See Also:
Constant Field Values
Constructor Detail

Stopwatch

public Stopwatch()
Create a stopwatch with millisecond resolution.


Stopwatch

public Stopwatch(long p_lResolution)
Create a stopwatch with a given resolution.

Parameters:
p_lResolution - One of MILLIS, MICROS or NANOS.
Method Detail

start

public void start()
Start the stopwatch.


stop

public long stop()
Get the meantime in milliseconds.

Returns:
The meantime in milliseconds.

restart

public long restart()
Get the meantime in milliseconds and reset to zero.

Returns:
The meantime in milliseconds.


Last updated: 2011-01-27
Copyright 2000-2010 United Planet. All Rights Reserved.