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.
- Alphabetic
- By Inheritance
- Stopwatch
- Stopwatch
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def const(dur: Duration): Stopwatch
A Stopwatch that always returns
dur
for the elapsed duration. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def start(): Elapsed
Start the stopwatch.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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.
- 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.
- 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.
- 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
. - 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
. - 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
. - def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()