All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.objectspace.jgl.util.Benchmark

java.lang.Object
   |
   +----COM.objectspace.jgl.util.Benchmark

public class Benchmark
extends Object
implements Serializable
A utility class for performing benchmarks.


Constructor Index

 o Benchmark()
Construct a benchmark with the title that never displays its status automatically.
 o Benchmark(String)
Construct a benchmark with the specified title that never displays its status automatically.
 o Benchmark(String, int)
Construct a benchmark with the specified title that displays its status automatically after every specified number of start/stop cycles.

Method Index

 o compareTo(Benchmark)
Display a string that compares me with another benchmark to System.out.
 o getCount()
Return the number of times I've been started/restarted.
 o getMilliseconds()
Return the current number of milliseconds on the benchmark clock.
 o getTitle()
Return my title.
 o start()
Start/resume the benchmark clock.
 o stop()
Stop the benchmark clock.
 o toString()
Return a string that describes me.

Constructors

 o Benchmark
 public Benchmark(String string,
                  int n)
Construct a benchmark with the specified title that displays its status automatically after every specified number of start/stop cycles.

Parameters:
string - The title
n - The number of cycles
 o Benchmark
 public Benchmark(String string)
Construct a benchmark with the specified title that never displays its status automatically.

 o Benchmark
 public Benchmark()
Construct a benchmark with the title that never displays its status automatically.

Methods

 o start
 public void start()
Start/resume the benchmark clock.

 o stop
 public void stop()
Stop the benchmark clock.

 o getMilliseconds
 public long getMilliseconds()
Return the current number of milliseconds on the benchmark clock.

 o getTitle
 public String getTitle()
Return my title.

 o getCount
 public int getCount()
Return the number of times I've been started/restarted.

 o toString
 public String toString()
Return a string that describes me.

Overrides:
toString in class Object
 o compareTo
 public void compareTo(Benchmark benchmark)
Display a string that compares me with another benchmark to System.out.

Parameters:
benchmark - The benchmark to compare myself against.

All Packages  Class Hierarchy  This Package  Previous  Next  Index