Clock constructor

const Clock([
  1. TimeFunction timeFunc = systemTime
])

Creates a clock based on the given timeFunc.

If timeFunc is not provided, creates Clock based on system clock.

Custom timeFunc can be useful in unit-tests. For example, you might want to control what time it is now and set date and time expectations in your test cases.

Implementation

const Clock([TimeFunction timeFunc = systemTime]) : _time = timeFunc;