utils
Class StopWatch

java.lang.Object
  extended by utils.StopWatch

public class StopWatch
extends java.lang.Object


Constructor Summary
StopWatch()
           
 
Method Summary
static long benchMark(java.lang.Runnable r, int n)
          Run the runnable r n times and return the average time in ms.
 void clear()
          Zero the elapsedTime
 double getElapsedTime()
          This is the time between a mark and a record.
 long getTimeInMs()
           
static void main(java.lang.String[] args)
           
 void print(double N, java.lang.String message)
           
 void print(java.lang.String message)
           
 void report()
          Report the elapsed time between the mark and the record invocations to the System.out.
 void report(java.io.PrintStream ps)
           
 void start()
          record the current time in milliseconds affineTransform the start point.
 void stop()
          Compute the difference between the mark'd time and the current time, in milliseconds.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopWatch

public StopWatch()
Method Detail

start

public void start()
record the current time in milliseconds affineTransform the start point.


clear

public void clear()
Zero the elapsedTime


stop

public void stop()
Compute the difference between the mark'd time and the current time, in milliseconds. The record method computes the elapsed_time.


getElapsedTime

public double getElapsedTime()
This is the time between a mark and a record.

Returns:
the time in seconds as a float

getTimeInMs

public long getTimeInMs()

benchMark

public static long benchMark(java.lang.Runnable r,
                             int n)
Run the runnable r n times and return the average time in ms.

Parameters:
r -
n -
Returns:

report

public void report(java.io.PrintStream ps)

main

public static void main(java.lang.String[] args)

report

public void report()
Report the elapsed time between the mark and the record invocations to the System.out.


print

public void print(double N,
                  java.lang.String message)

print

public void print(java.lang.String message)