public class Timer
extends java.lang.Object
This class does not keep an active time progression count of any kind.
Instead it just logs when the class instance is created.
Each subsequent call to getElapsedTime()
returns
the number of nanoseconds that have passed since the creation of the class
instance.
Constructor and Description |
---|
Timer()
Constructs a
Timer . |
Modifier and Type | Method and Description |
---|---|
long |
getElapsedTime()
Returns the number of nanoseconds that have passed since the creation
of the
Timer . |
java.lang.String |
getElapsedTimeString()
Returns a formatted
String holding the number of
minutes, seconds and milliseconds that have passed since the creation
of the Timer . |
public long getElapsedTime()
Timer
.long
holding the elapsed time in nanoseconds.public java.lang.String getElapsedTimeString()
String
holding the number of
minutes, seconds and milliseconds that have passed since the creation
of the Timer
.String
holding the elapsed time.