org.ceryle.util
Class Timer

java.lang.Object
  extended by org.ceryle.util.Timer

public class Timer
extends Object

A timer to keep track of elapsed time for an application.

Since:
JDK1.3
Version:
$Id: Timer.java,v 3.3 2007-06-15 12:09:57 altheim Exp $
Author:
Murray Altheim

Constructor Summary
Timer()
           
 
Method Summary
 long elapsedMilliseconds()
          Return elapsed time in milliseconds.
 long elapsedSeconds()
          Return elapsed time in seconds.
 String elapsedTimeString()
          Return the current elapsed time as a String in milliseconds or seconds (if greater than 1 second).
 void reset()
          Resets the process timer.
 void start()
          Start the process timer.
 long stop()
          Stop the process timer, setting elapsedTime.
 String totalTimeString()
          Return total time as a String in milliseconds or seconds (if greater than 1 second).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Method Detail

start

public void start()
Start the process timer.


reset

public void reset()
Resets the process timer.


stop

public long stop()
Stop the process timer, setting elapsedTime.


elapsedMilliseconds

public long elapsedMilliseconds()
Return elapsed time in milliseconds.


elapsedSeconds

public long elapsedSeconds()
Return elapsed time in seconds.


elapsedTimeString

public String elapsedTimeString()
Return the current elapsed time as a String in milliseconds or seconds (if greater than 1 second).


totalTimeString

public String totalTimeString()
Return total time as a String in milliseconds or seconds (if greater than 1 second). This returns the time captured when the timer was stopped.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.