org.minueto
Class MinuetoStopWatch

java.lang.Object
  extended by org.minueto.MinuetoStopWatch

public class MinuetoStopWatch
extends java.lang.Object

The MinuetoStopWatch class is used to measure time. It functions are similar to those found on a stopwatch. MinuetoStopWatch measures time in milliseconds. However, it is only more or less 20 milliseconds precise.

Since:
Minueto 0.4

Constructor Summary
MinuetoStopWatch()
          Create a MinuetoStopWatch and set its value to 0.
 
Method Summary
 long getTime()
          If the stopwatch is running, returns the time ellapse in millisecond between the invocation of the start method and the invocation of this method.
 void reset()
          Reset the value of the stopwatch to 0.
 void start()
          Start the stopwatch.
 void stop()
          Stop the stopwatch.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinuetoStopWatch

public MinuetoStopWatch()
Create a MinuetoStopWatch and set its value to 0.

Method Detail

start

public void start()
Start the stopwatch. Once started, the stopwatch can be stopped using the stop or reset method. Additionnals invocation of the start method are ignored if the stopwatch is already running.


stop

public void stop()
Stop the stopwatch. If this method is invoked twice, the second call has no effect.


reset

public void reset()
Reset the value of the stopwatch to 0. If the stopwatch was running, it is stopped.


getTime

public long getTime()
If the stopwatch is running, returns the time ellapse in millisecond between the invocation of the start method and the invocation of this method. Otherwise, returns the time ellapse between invocation of the start and stop method.

Returns:
the current value of the stopwatch.