edu.cs.ai.kreator.misc.util
Class Timer

java.lang.Object
  extended by edu.cs.ai.kreator.misc.util.Timer

public class Timer
extends java.lang.Object

Author:
Sebastian Loh

Field Summary
static org.apache.log4j.Logger LOG
           
 
Constructor Summary
Timer()
          constructs a new Timer Object which is not started yet.
Timer(boolean start)
          constructs a new Timer Object which is started in the moment of construction if start == true.
 
Method Summary
 java.lang.String getTime()
           
 java.lang.String round()
           
 void start()
          Starts the timer.
 java.lang.String stop()
           
 long stopTime()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Constructor Detail

Timer

public Timer()
constructs a new Timer Object which is not started yet.


Timer

public Timer(boolean start)
constructs a new Timer Object which is started in the moment of construction if start == true.

Parameters:
start -
Method Detail

start

public void start()
Starts the timer.


stop

public java.lang.String stop()
Returns:
a formated String of the milliseconds which has past since the timer was started and stops the timer.

stopTime

public long stopTime()

getTime

public java.lang.String getTime()
Returns:
the time which was past since the timer was started.

round

public java.lang.String round()
Returns:
the time which past since the last time the method was called. if the method was never called, its returns the time that past since the timer was started.