Clock

zio.Clock$
See theClock companion trait
object Clock extends Serializable

Attributes

Companion
trait
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type
Clock.type

Members list

Type members

Classlikes

final case class ClockJava(clock: Clock) extends Clock

An implementation of the Clock service backed by a java.time.Clock.

An implementation of the Clock service backed by a java.time.Clock.

Attributes

Supertypes
trait Product
trait Equals
trait Clock
trait Serializable
class Object
trait Matchable
class Any
Show all
object ClockLive extends Clock

Attributes

Supertypes
trait Clock
trait Serializable
class Object
trait Matchable
class Any
Self type
ClockLive.type

Value members

Concrete methods

def currentDateTime(implicit trace: Trace): UIO[OffsetDateTime]

Get the current time, represented in the current timezone.

Get the current time, represented in the current timezone.

Attributes

def currentTime(unit: => TimeUnit)(implicit trace: Trace): UIO[Long]

Returns the current time, relative to the Unix epoch.

Returns the current time, relative to the Unix epoch.

Attributes

def currentTime(unit: => ChronoUnit)(implicit trace: Trace, d: DummyImplicit): UIO[Long]
def instant(implicit trace: Trace): UIO[Instant]
def javaClock(implicit trace: Trace): UIO[Clock]

Constructs a java.time.Clock backed by the Clock service.

Constructs a java.time.Clock backed by the Clock service.

Attributes

def localDateTime(implicit trace: Trace): UIO[LocalDateTime]
def nanoTime(implicit trace: Trace): UIO[Long]

Returns the system nano time, which is not relative to any date.

Returns the system nano time, which is not relative to any date.

Attributes

def scheduler(implicit trace: Trace): UIO[Scheduler]

Returns the scheduler used for scheduling effects.

Returns the scheduler used for scheduling effects.

Attributes

def sleep(duration: => Duration)(implicit trace: Trace): UIO[Unit]

Sleeps for the specified duration. This is always asynchronous.

Sleeps for the specified duration. This is always asynchronous.

Attributes

Concrete fields

val tag: Tag[Clock]