Clock

trait Clock[F[_]] extends ClockPlatform[F]

A typeclass which encodes various notions of time. Analogous to some of the time functions exposed by java.lang.System.

Companion
object
trait ClockPlatform[F]
class Object
trait Matchable
class Any
trait GenTemporal[F, E]
trait Sync[F]
trait Async[F]

Value members

Abstract methods

def applicative: Applicative[F]
def monotonic: F[FiniteDuration]

Monotonic time subject to the law that (monotonic, monotonic).mapN(_ <= _)

Monotonic time subject to the law that (monotonic, monotonic).mapN(_ <= _)

Analogous to java.lang.System.nanoTime

def realTime: F[FiniteDuration]

A representation of the current system time

A representation of the current system time

Analogous to java.lang.System.currentTimeMillis

Concrete methods

def timed[A](fa: F[A]): F[(FiniteDuration, A)]

Returns an effect that completes with the result of the source together with the duration that it took to complete.

Returns an effect that completes with the result of the source together with the duration that it took to complete.

Value Params
fa

The effect which we wish to time the execution of

Inherited methods

def realTimeInstant: F[Instant]
Inherited from
ClockPlatform