Increments the wall clock time by the specified duration.
Returns the current fiber time as an OffsetDateTime
.
Returns the current fiber time as an OffsetDateTime
.
Returns the current fiber time in the specified time unit.
Returns the current fiber time in the specified time unit.
Returns the current fiber time for this fiber.
Returns the current fiber time for this fiber. The fiber time is backed
by a FiberRef
and is incremented for the duration each fiber is
sleeping. When a fiber is joined the fiber time will be set to the
maximum of the fiber time of the parent and child fibers. Thus, the
fiber time reflects the duration of sleeping that has occurred for this
fiber to reach its current state, properly reflecting forks and joins.
for { _ <- TestClock.set(Duration.Infinity) _ <- ZIO.sleep(2.millis).zipPar(ZIO.sleep(1.millis)) result <- TestClock.fiberTime } yield result.toNanos == 2000000L
Returns the current fiber time in nanoseconds.
Returns the current fiber time in nanoseconds.
Runs all scheduled effects.
Saves the TestClock
's current state in an effect which, when run,
will restore the TestClock
state to the saved state
Saves the TestClock
's current state in an effect which, when run,
will restore the TestClock
state to the saved state
Sets the wall clock time to the specified OffsetDateTime
.
Sets the wall clock time to the specified time in terms of duration since the epoch.
Sets the time zone to the specified time zone.
Semantically blocks the current fiber until the wall clock time is equal to or greater than the specified duration.
Semantically blocks the current fiber until the wall clock time is equal to or greater than the specified duration. Once the wall clock time is adjusted to on or after the duration, the fiber will automatically be resumed.
Returns a list of the wall clock times at which all queued effects are scheduled to resume.
Returns the time zone.