Dashboard Builder Commons 6.2.0.Beta1

org.jboss.dashboard.commons.misc
Class Chronometer

java.lang.Object
  extended by org.jboss.dashboard.commons.misc.Chronometer

public final class Chronometer
extends Object

The class Chronometer permits to measure the time, with millisecond precision.


Field Summary
protected  Map marks
           
protected  Long stopTime
           
 
Constructor Summary
Chronometer()
           
 
Method Summary
 long elapsedTime()
          Return the elapsed time measured in milliseconds since the very start.
 long elapsedTime(String mark)
          Return the elapsed time measured in milliseconds since the specified mark was set.
static String formatElapsedTime(long millis)
           
static void main(String[] arg)
          Main function
 void resume()
          Resume the timer.
 void start()
          Start the timer.
 void start(String mark)
          Set a mark.
 void stop()
          Stop the timer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

marks

protected Map marks

stopTime

protected Long stopTime
Constructor Detail

Chronometer

public Chronometer()
Method Detail

start

public void start()
Start the timer.


stop

public void stop()
Stop the timer.


resume

public void resume()
Resume the timer.


start

public void start(String mark)
Set a mark.


elapsedTime

public long elapsedTime()
Return the elapsed time measured in milliseconds since the very start.

Returns:
long, the time.

elapsedTime

public long elapsedTime(String mark)
Return the elapsed time measured in milliseconds since the specified mark was set.

Returns:
long, the time.

formatElapsedTime

public static String formatElapsedTime(long millis)

main

public static void main(String[] arg)
                 throws Exception
Main function

Parameters:
arg - command-line arguments.
Throws:
Exception

Dashboard Builder Commons 6.2.0.Beta1

Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.