muscle::util::Timer Class Reference
![](classmuscle_1_1util_1_1_timer.png)
Public Member Functions | |
Timer () | |
long | reset () |
void | pause () |
void | unpause () |
boolean | isPaused () |
String | toString () |
void | println (String msg) |
long | millisec () |
long | nanosec () |
long | getBaseTime () |
void | setTime (long time) |
Static Public Member Functions | |
static String | toString (long diff) |
Protected Member Functions | |
long | getTime () |
Detailed Description
An unsynchronized timer, based on a stopwatch. It reports wall-clock time.Constructor & Destructor Documentation
muscle::util::Timer::Timer | ( | ) | [inline] |
Member Function Documentation
long muscle::util::Timer::reset | ( | ) | [inline] |
Reset the timer and returns its current value. The timer will start running again immediately after calling reset.
Reimplemented in muscle::util::SynchronizedTimer.
void muscle::util::Timer::pause | ( | ) | [inline] |
Pause the timer. May be called multiple times. Has no effect on a paused timer.
Reimplemented in muscle::util::SynchronizedTimer.
void muscle::util::Timer::unpause | ( | ) | [inline] |
Remove the pause from a timer. Has no effect if the timer is running.
Reimplemented in muscle::util::SynchronizedTimer.
boolean muscle::util::Timer::isPaused | ( | ) | [inline] |
Whether the timer is paused.
Reimplemented in muscle::util::SynchronizedTimer.
String muscle::util::Timer::toString | ( | ) | [inline] |
Returns a string representation of the current time. This resets the timer.
static String muscle::util::Timer::toString | ( | long | diff | ) | [inline, static] |
Returns a string representation of a given number of nanoseconds.
void muscle::util::Timer::println | ( | String | msg | ) | [inline] |
Print a message to standard out with the current time. This resets the timer.
- Parameters:
-
msg Message to print
long muscle::util::Timer::millisec | ( | ) | [inline] |
The current time of the timer in milliseconds.
long muscle::util::Timer::nanosec | ( | ) | [inline] |
The current time of the timer in nanoseconds.
Reimplemented in muscle::util::SynchronizedTimer.
long muscle::util::Timer::getBaseTime | ( | ) | [inline] |
Get the starting time of the timer, or the time of the last reset.
Reimplemented in muscle::util::SynchronizedTimer.
void muscle::util::Timer::setTime | ( | long | time | ) | [inline] |
Set the starting time to a certain value. If the timer was paused, it will no longer be paused
Reimplemented in muscle::util::SynchronizedTimer.
long muscle::util::Timer::getTime | ( | ) | [inline, protected] |
Get the current time in nanoseconds. Override for different time standards.
Reimplemented in muscle::util::concurrency::ThreadCpuTimer.
Generated on Thu Oct 18 14:28:29 2012 for Muscle Java API by
![doxygen](doxygen.png)