Class Timing


  • public class Timing
    extends Object
    Helper class to time the execution of elements
    • Constructor Summary

      Constructors 
      Constructor Description
      Timing()
      Get a timer that is started.
      Timing​(boolean start)
      Get a timing that is optionally started
    • Constructor Detail

      • Timing

        public Timing()
        Get a timer that is started.
      • Timing

        public Timing​(boolean start)
        Get a timing that is optionally started
        Parameters:
        start - If the timer should reset its time.
    • Method Detail

      • start

        public void start()
        Starts the time measurement.
      • stop

        public double stop()
        Measures and returns the time since the last start() or stop() invocation and restarts the measurement.
        Returns:
        duration between start and stop
      • stopAndPrint

        public void stopAndPrint()
        Measures and returns the time since the last start() or stop() invocation, restarts the measurement, and prints the last measurement to STDOUT.