Clock
Constructors
Signature
declare const clockWith: <A, E, R>(
f: (clock: Clock) => Effect.Effect<A, E, R>,
) => Effect.Effect<A, E, R>;currentTimeMillis
Added in v2.0.0
Source
Signature
declare const currentTimeMillis: Effect.Effect<number>;currentTimeNanos
Added in v2.0.0
Source
Signature
declare const currentTimeNanos: Effect.Effect<bigint>;Signature
declare const make: (_: void) => Clock;Signature
declare const sleep: (duration: Duration.DurationInput) => Effect.Effect<void>;Context
Models
CancelToken type
Added in v2.0.0
Source
Signature
type CancelToken = () => boolean;Signature
interface Clock {
readonly [ClockTypeId]: typeof ClockTypeId;
readonly currentTimeMillis: Effect<number>;
readonly currentTimeNanos: Effect<bigint>;
sleep(duration: Duration): Effect<void>;
unsafeCurrentTimeMillis(): number;
unsafeCurrentTimeNanos(): bigint;
}ClockScheduler interface
Added in v2.0.0
Source
Signature
interface ClockScheduler {
unsafeSchedule(task: Task, duration: Duration): CancelToken;
}Signature
type Task = () => void;Symbols
ClockTypeId
Added in v2.0.0
Source
Signature
declare const ClockTypeId: unique symbol;ClockTypeId type
Added in v2.0.0
Source
Signature
type ClockTypeId = typeof ClockTypeId;
Represents a time-based clock which provides functionality related to time and scheduling.