Clock
eff Clock
SourceAn effect used to access the current (real-world) time.
Operations
def currentTime(u: TimeUnit): Int64
SourceReturns a measure of time since the epoch in the given time unit u
.
Definitions
def handle(f: a -> b \ ef): a -> b \ (ef & (~Clock)) + IO
SourceHandles the Clock
effect of the given function f
.
In other words, re-interprets the Clock
effect using the IO
effect.
def now(): Int64 \ Clock
SourceReturns the number of milliseconds since the epoch.
Equivalent to currentTime(TimeUnit.Milliseconds)
.
def runWithIO(f: Unit -> a \ ef): a \ (ef & (~Clock)) + IO
SourceRuns the Clock
effect of the given function f
.
In other words, re-interprets the Clock
effect using the IO
effect.