Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.util
Class Stopwatch  view Stopwatch download Stopwatch.java

java.lang.Object
  extended bycom.eireneh.util.Stopwatch

public class Stopwatch
extends java.lang.Object

A Little performance tool

Version:
$Id:$

Field Summary
private static java.util.List accumulated
          The accumulated data
private static java.lang.ThreadLocal local
          The accumulated data
private static java.lang.ThreadLocal origin
          When the program started
 
Constructor Summary
private Stopwatch()
          Ensure we cant be instantiated
 
Method Summary
static void lap(java.lang.String name)
          Marks a waypoint in the current timing run
static void main(java.lang.String[] args)
          Quick test
static void report(boolean reset)
          Report on the state of the completed timings so far
private static void report(java.lang.String id, java.util.Map times)
          Produce a single report
static void start()
          Start the current thread on a timing run
static void stop()
          Ends the timing run on the current thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

origin

private static java.lang.ThreadLocal origin
When the program started


local

private static java.lang.ThreadLocal local
The accumulated data


accumulated

private static java.util.List accumulated
The accumulated data

Constructor Detail

Stopwatch

private Stopwatch()
Ensure we cant be instantiated

Method Detail

start

public static void start()
                  throws java.lang.IllegalStateException
Start the current thread on a timing run


lap

public static void lap(java.lang.String name)
Marks a waypoint in the current timing run


stop

public static void stop()
Ends the timing run on the current thread


report

public static void report(boolean reset)
Report on the state of the completed timings so far


report

private static void report(java.lang.String id,
                           java.util.Map times)
Produce a single report


main

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