elapsed

Get the elapsed time in nanoseconds. Depending on the state of the stopwatch, two values or an IllegalStateException may be thrown.

  1. Stopwatch is still running: The elapsed time up to the point of calling this method is returned.

  2. Stopwatch started and stopped: The elapsed time between the start and stop is returned.

  3. Any other state: An IllegalStateException is thrown.

Return

The elapsed time in nanoseconds.

Author

Griefed

Throws

when the stopwatch is in an invalid state for time-retrieval.