Class TimeAccumulator

java.lang.Object
noaa.coastwatch.test.TimeAccumulator

public class TimeAccumulator extends Object
A TimeAccumulator object can be used for precise accumulation of time used in a thread for performance testing.
Since:
3.4.0
Author:
Peter Hollemans
  • Constructor Details

    • TimeAccumulator

      public TimeAccumulator()
  • Method Details

    • start

      public void start()
      Marks the start of a CPU time recording session.
    • end

      public void end()
      Marks the end of a CPU time recording session and adds the accumulated time to the total.
    • add

      public void add(TimeAccumulator acc)
      Adds the time from another accumulator to this one. This operation is thread safe.
      Parameters:
      acc - the accumulator with time to add to this one.
    • totalSeconds

      public double totalSeconds()
      Gets the total time accumulated.
      Returns:
      the time accumulated in seconds.
    • reset

      public void reset()
      Resets the accumulated time.