jigcell.xpp
Class Stopwatch
java.lang.Object
jigcell.xpp.Stopwatch
public class Stopwatch
- extends java.lang.Object
A class to help benchmark code
It simulates a real stop watch
|
Method Summary |
static long |
getElapsedTime()
returns elapsed time in milliseconds
if the watch has never been started then
return zero |
static void |
reset()
|
static void |
start()
|
static void |
stop()
|
static long |
tic()
Get elapsed time and restart stopwatch |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
startTime
private static long startTime
stopTime
private static long stopTime
running
private static boolean running
Stopwatch
public Stopwatch()
start
public static void start()
stop
public static void stop()
getElapsedTime
public static long getElapsedTime()
- returns elapsed time in milliseconds
if the watch has never been started then
return zero
tic
public static long tic()
- Get elapsed time and restart stopwatch
- Returns:
reset
public static void reset()