Class StopWatchUtils


  • public class StopWatchUtils
    extends Object
    Utilities for working with StopWatch.
    Author:
    poirigui
    • Constructor Detail

      • StopWatchUtils

        public StopWatchUtils()
    • Method Detail

      • measuredRegion

        public static StopWatchUtils.StopWatchRegion measuredRegion​(org.apache.commons.lang3.time.StopWatch stopWatch)
        Create a measured region by a StopWatch, which can be used with a try-with-resource statement to StopWatch.start() and StopWatch.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.