public class Timer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Timer.TimerState |
Constructor and Description |
---|
Timer()
Initializes a new Timer instance and sets the elapsed time to zero.
|
Timer(String name)
Initializes a new Timer instance with the given name and sets the elapsed time to zero.
|
Modifier and Type | Method and Description |
---|---|
long |
getElapsedMilliseconds() |
String |
getName() |
protected Timer.TimerState |
getState() |
boolean |
isRunning() |
void |
pause()
Pauses the time measurement.
|
void |
resume()
Resumes the time measurement.
|
void |
start()
Starts the time measurement if the timer is currently stopped.
|
static Timer |
startNew()
Initializes a new Timer instance, sets the elapsed time to zero, and starts measuring elapsed time.
|
static Timer |
startNew(String name)
Initializes a new Timer instance with the given name, sets the elapsed time to zero, and starts measuring elapsed time.
|
void |
stop()
Stops the time measurement.
|
String |
toString() |
public Timer()
public Timer(String name)
name
- The name of the timer. This parameter is provided for interfacing with Silk Performer.
public static Timer startNew()
public static Timer startNew(String name)
name
- The name of the timer. This parameter is provided for interfacing with Silk Performer.public String getName()
public boolean isRunning()
public long getElapsedMilliseconds()
protected Timer.TimerState getState()
public void start()
public void pause()
public void resume()
public void stop()
Copyright 2009-2012 Micro Focus. All Rights Reserved.