| java.lang.Object net.sf.ehcache.StopWatch
StopWatch | public class StopWatch (Code) | | A timer service used to check performance of tests.
To enable this to work for different machines the following is done:
- SimpleLog is used for logging with a known logging level controlled by
simplelog.properties
which is copied to the test classpath. This removes logging as a source of differences.
Messages are sent to stderr which also makes it easy to see messages on remote continuous integration
machines.
- A speedAdjustmentFactor is used to equalize machines. It is supplied as a the System Property
'net.sf.ehcache.speedAdjustmentFactor=n', where n is the number of times the machine is slower
than the reference machine e.g. 1.1. This factor is then used to adjust "elapsedTime"
as returned by this class. Elapsed Time is therefore not true time, but notional time equalized with the reference
machine. If you get performance tests failing add this property.
author: Greg Luck version: $Id: StopWatch.java 519 2007-07-27 07:11:45Z gregluck $ version: A stop watch that can be useful for instrumenting for performance |
getElapsedTime | public long getElapsedTime()(Code) | | Gets the time elapsed between now and for the first time, the creation
time of the class, and after that, between each call to this method
Note this method returns notional time elapsed. See class description
|
getElapsedTimeString | public String getElapsedTimeString()(Code) | | formatted elapsed Time |
getSpeedAdjustmentFactor | public static float getSpeedAdjustmentFactor()(Code) | | Get the speed adjustment factor
|
|
|