| |
|
| java.lang.Object org.wings.util.TimeMeasure
TimeMeasure | public class TimeMeasure (Code) | | Some simple stop watch. It allows to measure multiple time periods
and prints them. Usage: call start(comment) and stop() for
each period of time.
author: Armin Haaf |
Constructor Summary | |
public | TimeMeasure() Simple TimeMesaure with default format. | public | TimeMeasure(MessageFormat formatter) A new TimeMeasure which reports in a specific format. |
Method Summary | |
public String | print() | public String | print(boolean shortestIsReference) creates a formatted output (using the MessageFormat) of all
results. | public void | reset() Reset of all Measurements. | public void | start(String comment) | public void | stop() stop current time measurement and store it. | public String | toString() |
RESOLUTION | final protected static double RESOLUTION(Code) | | |
current | protected Measure current(Code) | | the current time measurement.
|
TimeMeasure | public TimeMeasure()(Code) | | Simple TimeMesaure with default format.
|
TimeMeasure | public TimeMeasure(MessageFormat formatter)(Code) | | A new TimeMeasure which reports in a specific format. The
format is a standard MessageFormat with the following variables:
{0} the measurement comment
{1} the time it took
{2} how many times this is faster than the
slowest measurement
|
print | public String print(boolean shortestIsReference)(Code) | | creates a formatted output (using the MessageFormat) of all
results. The output is sorted in the in the sequence the time
measurements took place.
Writes the relative time to either the shortest or the longest
time interval.
Parameters: shortestIsReference - boolean true, if the shortest time intervalis the reference value (1.0). False, if thelongest is the reference. |
reset | public void reset()(Code) | | Reset of all Measurements.
|
stop | public void stop()(Code) | | stop current time measurement and store it.
|
|
|
|