public class Timer extends java.lang.Object implements java.io.Serializable, StringBuilderFormattable
| Modifier and Type | Class and Description |
|---|---|
static class |
Timer.Status |
| Constructor and Description |
|---|
Timer(java.lang.String name)
Constructor.
|
Timer(java.lang.String name,
int iterations)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
void |
formatTo(java.lang.StringBuilder buffer)
Writes a text representation of this object into the specified
StringBuilder, ideally without allocating
temporary objects. |
long |
getElapsedNanoTime()
Access the elapsed time.
|
long |
getElapsedTime()
Access the elapsed time.
|
java.lang.String |
getName()
Accessor for the name.
|
Timer.Status |
getStatus()
Returns the name of the last operation performed on this timer (Start, Stop, Pause or
Resume).
|
int |
hashCode() |
void |
pause()
Pause the timer.
|
void |
resume()
Resume the timer.
|
void |
start()
Start the timer.
|
void |
startOrResume() |
java.lang.String |
stop()
Stop the timer.
|
java.lang.String |
toString()
Returns the String representation of the timer based upon its current state
|
public Timer(java.lang.String name)
name - the timer name.public Timer(java.lang.String name,
int iterations)
name - the timer name.public void start()
public void startOrResume()
public java.lang.String stop()
public void pause()
public void resume()
public java.lang.String getName()
public long getElapsedTime()
public long getElapsedNanoTime()
public Timer.Status getStatus()
public java.lang.String toString()
toString in class java.lang.Objectpublic void formatTo(java.lang.StringBuilder buffer)
StringBuilderFormattableStringBuilder, ideally without allocating
temporary objects.formatTo in interface StringBuilderFormattablebuffer - the StringBuilder to write intopublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2006-2021 OPS4J - Open Participation Software for Java. All Rights Reserved.