org.opensubsystems.core.util
Class MyTimer

java.lang.Object
  extended by org.opensubsystems.core.util.MyTimer

public class MyTimer
extends java.lang.Object

Class encapsulating timer functionality.

Version:
$Id: MyTimer.java,v 1.5 2007/01/07 06:14:00 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Constructor Summary
MyTimer()
          Default constructor.
 
Method Summary
 long getDuration()
          Get timer duration (the timer doesn't stop) in milliseconds.
 long getStartTime()
           
 long getStopTime()
           
 void reset()
          Reset the counter and start counting from scratch.
 void stop()
          Stop the timer.
 java.lang.String toString()
          Print the state of the timer without stopping it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MyTimer

public MyTimer()
Default constructor. Starts counting fro the moment it is cosntructed.

Method Detail

getStartTime

public long getStartTime()
Returns:
long - start time;

getStopTime

public long getStopTime()
Returns:
- stop time;

reset

public void reset()
Reset the counter and start counting from scratch.


stop

public void stop()
Stop the timer.


getDuration

public long getDuration()
Get timer duration (the timer doesn't stop) in milliseconds.

Returns:
long - difference between stop and start time.

toString

public java.lang.String toString()
Print the state of the timer without stopping it.

Overrides:
toString in class java.lang.Object
Returns:
String - timing information


Copyright © 2003 - 2006 OpenSubsystems s.r.o.