Packages

object Stopwatch extends Stopwatch

The system Stopwatch measures elapsed time using System.nanoTime.

Note that it works well with unit tests by respecting time manipulation on Time.

See also

Stopwatches for Java APIs.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Stopwatch
  2. Stopwatch
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type Elapsed = () => Duration
    Definition Classes
    Stopwatch

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def const(dur: Duration): Stopwatch

    A Stopwatch that always returns dur for the elapsed duration.

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. def start(): Elapsed

    Start the stopwatch.

    Start the stopwatch. The returned timer may be read any time, returning the duration of time elapsed since start.

    Definition Classes
    StopwatchStopwatch
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. val systemMicros: () => Long

    A function that returns a Long that can be used for measuring elapsed time in microseconds, using the system clock.

    A function that returns a Long that can be used for measuring elapsed time in microseconds, using the system clock.

    Note that invoking this doesn't entail any allocations.

  19. val systemMillis: () => Long

    A function that returns a Long that can be used for measuring elapsed time in milliseconds, using the system clock.

    A function that returns a Long that can be used for measuring elapsed time in milliseconds, using the system clock.

    Note that invoking this doesn't entail any allocations.

  20. val systemNanos: () => Long

    A function that returns a Long that can be used for measuring elapsed time in nanoseconds, using the system clock.

    A function that returns a Long that can be used for measuring elapsed time in nanoseconds, using the system clock.

    Note that invoking this doesn't entail any allocations.

  21. val timeMicros: () => Long

    A function that returns a Long that can be used for measuring elapsed time in microseconds, that is Time manipulation compatible.

    A function that returns a Long that can be used for measuring elapsed time in microseconds, that is Time manipulation compatible.

    Useful for testing, but should not be used in a tight loop in production, since it entails a few allocations and does a Local lookup. For production, see systemMicros.

  22. val timeMillis: () => Long

    A function that returns a Long that can be used for measuring elapsed time in milliseconds, that is Time manipulation compatible.

    A function that returns a Long that can be used for measuring elapsed time in milliseconds, that is Time manipulation compatible.

    Useful for testing, but should not be used in a tight loop in production, since it entails a few allocations and does a Local lookup. For production, see systemMillis.

  23. val timeNanos: () => Long

    A function that returns a Long that can be used for measuring elapsed time in nanoseconds, that is Time manipulation compatible.

    A function that returns a Long that can be used for measuring elapsed time in nanoseconds, that is Time manipulation compatible.

    Useful for testing, but should not be used in a tight loop in production, since it entails a few allocations and does a Local lookup. For production, see systemNanos.

  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Stopwatch

Inherited from AnyRef

Inherited from Any

Ungrouped