Package ubic.gemma.core.util
Class StopWatchUtils
- java.lang.Object
-
- ubic.gemma.core.util.StopWatchUtils
-
public class StopWatchUtils extends Object
Utilities for working withStopWatch
.- Author:
- poirigui
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StopWatchUtils.StopWatchRegion
-
Constructor Summary
Constructors Constructor Description StopWatchUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StopWatchUtils.StopWatchRegion
measuredRegion(org.apache.commons.lang3.time.StopWatch stopWatch)
Create a measured region by aStopWatch
, which can be used with a try-with-resource statement toStopWatch.start()
andStopWatch.suspend()
when entering and leaving the region.
-
-
-
Method Detail
-
measuredRegion
public static StopWatchUtils.StopWatchRegion measuredRegion(org.apache.commons.lang3.time.StopWatch stopWatch)
Create a measured region by aStopWatch
, which can be used with a try-with-resource statement toStopWatch.start()
andStopWatch.suspend()
when entering and leaving the region. If the stop watch is suspended, let's say from a previous call to this function, it will be resumed, allowing for a cumulative measurement of time usage. This is really handy to measure code regions and report time usage.
-
-