Class StopwatchCPU


  • public class StopwatchCPU
    extends Object
    The StopwatchCPU data type is for measuring the CPU time used during a programming task. See Stopwatch for a version that measures wall-clock time (the real time that elapses).
    Author:
    Josh Hug, Robert Sedgewick, Kevin Wayne
    • Constructor Detail

      • StopwatchCPU

        public StopwatchCPU()
        Initializes a new stopwatch.
    • Method Detail

      • elapsedTime

        public double elapsedTime()
        Returns the elapsed CPU time (in seconds) since the stopwatch was created.
        Returns:
        elapsed CPU time (in seconds) since the stopwatch was created