Package biz.onixs.util
Class PrecisionTimer
- java.lang.Object
-
- biz.onixs.util.PrecisionTimer
-
public class PrecisionTimer extends Object
PrecisionTimer for measuring small time periods to estimate performance.
-
-
Constructor Summary
Constructors Constructor Description PrecisionTimer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetAvgIntervalMilliSeconds()longgetAvgIntervalNanoSeconds()longgetAvgIntervalSeconds()longgetElapsedMilliSeconds()Returns the elapsed time in milliseconds.longgetElapsedNanoSeconds()Returns the elapsed time in nanoseconds.longgetElapsedSeconds()Returns the elapsed time in seconds.doublegetItemsPerSecond(long nItems)longgetLastIntervalMilliSeconds()longgetLastIntervalNanoSeconds()longgetLastIntervalSeconds()longgetMaxIntervalMilliSeconds()longgetMaxIntervalNanoSeconds()longgetMaxIntervalSeconds()doublegetMicroSecondsPerItem(long nItems)static doublegetMicroSecondsPerItem(long elapsed, long nItems)doublegetMilliSecondsPerItem(long nItems)static doublegetMilliSecondsPerItem(long elapsed, long nItems)doublegetNanoSecondsPerItem(long nItems)static doublegetNanoSecondsPerItem(long elapsed, long nItems)doublegetSecondsPerItem(long nItems)static doublegetSecondsPerItem(long elapsed, long nItems)voidreset()longstart()longstart(long startTime)longstop()StringtoString()longupdate()
-
-
-
Method Detail
-
start
public long start()
-
start
public long start(long startTime)
-
update
public long update()
-
stop
public long stop()
-
reset
public void reset()
-
getAvgIntervalNanoSeconds
public long getAvgIntervalNanoSeconds()
-
getAvgIntervalMilliSeconds
public long getAvgIntervalMilliSeconds()
-
getAvgIntervalSeconds
public long getAvgIntervalSeconds()
-
getMaxIntervalNanoSeconds
public long getMaxIntervalNanoSeconds()
-
getMaxIntervalMilliSeconds
public long getMaxIntervalMilliSeconds()
-
getMaxIntervalSeconds
public long getMaxIntervalSeconds()
-
getLastIntervalNanoSeconds
public long getLastIntervalNanoSeconds()
-
getLastIntervalMilliSeconds
public long getLastIntervalMilliSeconds()
-
getLastIntervalSeconds
public long getLastIntervalSeconds()
-
getElapsedNanoSeconds
public long getElapsedNanoSeconds()
Returns the elapsed time in nanoseconds.- Returns:
- the elapsed time (in nanoseconds).
-
getElapsedMilliSeconds
public long getElapsedMilliSeconds()
Returns the elapsed time in milliseconds.- Returns:
- the elapsed time (in milliseconds).
-
getElapsedSeconds
public long getElapsedSeconds()
Returns the elapsed time in seconds.- Returns:
- the elapsed time (in seconds).
-
getItemsPerSecond
public double getItemsPerSecond(long nItems)
-
getNanoSecondsPerItem
public double getNanoSecondsPerItem(long nItems)
-
getMicroSecondsPerItem
public double getMicroSecondsPerItem(long nItems)
-
getMilliSecondsPerItem
public double getMilliSecondsPerItem(long nItems)
-
getSecondsPerItem
public double getSecondsPerItem(long nItems)
-
getNanoSecondsPerItem
public static double getNanoSecondsPerItem(long elapsed, long nItems)
-
getMicroSecondsPerItem
public static double getMicroSecondsPerItem(long elapsed, long nItems)
-
getMilliSecondsPerItem
public static double getMilliSecondsPerItem(long elapsed, long nItems)
-
getSecondsPerItem
public static double getSecondsPerItem(long elapsed, long nItems)
-
-