HmsTimer

trait HmsTimer[T <: HmsTimer[T]]

This trait provides Timer functionalities based on the Java Calendar milliseconds

class Object
trait Matchable
class Any

Value members

Abstract methods

def copy(elapsed: List[Long], started: List[Long]): T

Concrete methods

def add(t: HmsTimer[T]): T

add 2 timers together

add 2 timers together

protected def getTime: Long

this method can be overridden for testing

this method can be overridden for testing

def hms: String
Returns:

a formatted string showing the hours, minutes and seconds

def hourMinutesSecondsMillis: (Long, Long, Long, Long)
Returns:

a tuple with the elapsed hours, minutes, seconds and millis

def isStarted: Boolean
Returns:

true if this timer has been started

def neverStarted: Boolean
Returns:

true if this timer has never been started

def restart: T

restarts the Timer with no elapsed time

restarts the Timer with no elapsed time

def start: T

starts the with new elapsed time

starts the with new elapsed time

def stop: T

Stop the timer, store the number of elapsed millis and return a String representing the time as hour/minute/second/ms

Stop the timer, store the number of elapsed millis and return a String representing the time as hour/minute/second/ms

Returns:

the elapsed time as a Long representing milliseconds

def time: String
Returns:

a formatted string showing the hours, minutes, seconds and millis

def totalMillis: Long

Concrete fields

protected val elapsedTimes: List[Long]

elapsed times since for each stop

elapsed times since for each stop

val startedTimestamps: List[Long]

each time the timer is started we add the current time to this list of times number of millis when instantiating the object using this Trait

each time the timer is started we add the current time to this list of times number of millis when instantiating the object using this Trait