Clock

eff ClockSource

An effect used to access the current (real-world) time.

Operations

def currentTime(u: TimeUnit): Int64 Source

Returns a measure of time since the epoch in the given time unit u.

Definitions

def now(): Int64 \ Clock Source

Returns the number of milliseconds since the epoch.

Equivalent to currentTime(TimeUnit.Milliseconds).

def run(f: Unit -> a \ ef): a \ (ef & (~Clock)) + IO Source

Runs the Clock effect of the given function f.

In other words, re-interprets the Clock effect using the IO effect.