Clock

trait Clock[F[_]] extends Serializable

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

Companion:
object
Source:
Clock.scala
trait Serializable
class Object
trait Matchable
class Any
trait GenTemporal[F, E]
trait Sync[F]
trait Async[F]

Value members

Abstract methods

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.

Source:
Clock.scala

A representation of the current system time

A representation of the current system time

Analogous to java.lang.System.currentTimeMillis.

Source:
Clock.scala

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 parameters:
fa

The effect which we wish to time the execution of

Source:
Clock.scala

Inherited methods

def realTimeInstant: F[Instant]
Inherited from:
ClockPlatform (hidden)
Source:
ClockPlatform.scala