public class Stopwatch extends Object
instance.start("stopwatch-name")where ''stopwatch-name'' is the symbolic name of a stopwatch. you can stop it using:
instance.stop("stopwatch-name")and get the benchmarks using the method stat. Please note that you can use start and stop multiple times, stat will provide you the average time and the total time.
Modifier and Type | Class and Description |
---|---|
class |
Stopwatch.SingleStopwatch
A single stopwatch.
|
Modifier and Type | Field and Description |
---|---|
long |
totalStopwatchesTime |
Constructor and Description |
---|
Stopwatch() |
Modifier and Type | Method and Description |
---|---|
static void |
main(String[] args) |
void |
start(String name)
Starts a stopwatch with symbolic name 'name'
|
String |
stat()
Returns a string with all the benchmarks for all the stopwatches started
|
String |
stat(String name)
Returns a string containing the benchmark for the stopwatch 'name'
|
long |
stop(String name)
Stops a stopwatch with symbolic name 'name'
|
public void start(String name)
name
- the symbolic name of the stopwatchpublic long stop(String name)
name
- the symbolic name of the stopwatchpublic String stat(String name)
name
- the symbolic name of the stopwatchpublic String stat()
public static void main(String[] args) throws InterruptedException
InterruptedException
Copyright © 2013. All rights reserved.