public class StopWatch extends Object
StopWatch timer = new StopWatch("Stopping my process");
// run your process
long elapsedTime = timer.stop();
// elapsedTime now contains the time, your process run. You may print it to a logger instance
log.info("process took " + elapsedTime / 1000 + " seconds");
| Modifier and Type | Method and Description |
|---|---|
void |
pause() |
void |
restart() |
long |
stop()
Method stop
|
String |
stop(DecimalFormat df) |
public StopWatch(String text)
text - An optional name for this StopWatch instancepublic long stop()
public String stop(DecimalFormat df)
public void pause()
public void restart()
Copyright © 2017 SAP SE. All Rights Reserved.