com.novell.xsl.util
Class Timer

java.lang.Object
  extended bycom.novell.xsl.util.Timer

public class Timer
extends Object

A simple class for measuring elapsed time. Timers start measuring elapsed time from the moment they are created. Timers can return the total elapsed time as well as a simple lap time.


Constructor Summary
Timer()
           
 
Method Summary
 long getLapTime()
          Returns the number of milliseconds for the current lap, then restarts the lap timer.
 long getTotalTime()
          Returns the number of milliseconds since this timer was created.
 String millisToString(long millis)
          Converts the specified number of milliseconds into seconds and returns it as a string with three digits after the decimal point.
 
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

millisToString

public String millisToString(long millis)
Converts the specified number of milliseconds into seconds and returns it as a string with three digits after the decimal point. The result is not properly internationalized.

Parameters:
millis - the number of milliseconds to be converted
Returns:
the number of seconds, with three digits after the decimal point

getLapTime

public long getLapTime()
Returns the number of milliseconds for the current lap, then restarts the lap timer.

Returns:
the lap time in milliseconds

getTotalTime

public long getTotalTime()
Returns the number of milliseconds since this timer was created.

Returns:
the total elapsed time in milliseconds