Increments the current clock time by the specified duration.
Returns the current clock time as an OffsetDateTime
.
Returns the current clock time as an OffsetDateTime
.
Returns the current clock time in the specified time unit.
Returns the current clock 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 clock time in nanoseconds.
Returns the current clock time in nanoseconds.
Returns an effect that creates a new Scheduler
backed by this
TestClock
.
Returns an effect that creates a new Scheduler
backed by this
TestClock
.
Sets the current clock time to the specified time.
Sets the time zone to the specified time zone.
Semantically blocks the current fiber until the clock time is equal to or greater than the specified duration.
Semantically blocks the current fiber until the clock time is equal to or greater than the specified duration. Once the clock time is adjusted to on or after the duration, the fiber will automatically be resumed.
Returns a list of the times at which all queued effects are scheduled to resume.
Returns the time zone.