trait Timer extends AnyRef
Provides timer functionality.
Based on my Java class Timer (as of 2006, has been nested in Clock class) that itself had a long history of Modula2 (1987-90) and C (1994) implementations.
The timer will start immediately on construction, so it is not required to start or reset it explictely (although it does no harm). Arbitrary many start (implicit or explicit) and stop cycles can be passed through. The times measured on each cycle are cumulated and the result is returned by the reading method, while the lap method adds the time since the last stop to that result.
Copyright (C) 1987, 1989, 1990, 1994, 2006, 2015 Hans-Hermann Bode
- Version
3.0
- Alphabetic
- By Inheritance
- Timer
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Concrete 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() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lap: Long
- returns
the current timer value (like the lap function of a stopwatch)
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def reading: Long
- returns
the cumulative time of all start/stop cycles so far
- def reset(): Unit
Sets the timer to zero.
- def start(): Unit
Starts a new measuring cycle without resetting the timer.
- def stop(): Long
Stops the current measuring cycle without resetting the timer.
Stops the current measuring cycle without resetting the timer.
- returns
the reading (cumulative time of all cycles so far)
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])