Liking cljdoc? Tell your friends :D

tea-time.virtual

Provides controllable periodic and deferred execution. Calling (advance! target-time-in-seconds) moves the clock forward, triggering events that would have occurred, in sequence. Each task executes exactly at its target time.

Provides controllable periodic and deferred execution. Calling (advance!
target-time-in-seconds) moves the clock forward, triggering events that would
have occurred, in sequence. Each task executes exactly at its target time.
raw docstring

advance!clj

(advance! t)

Advances the clock to t seconds, triggering side effects. Tasks are run synchronously on this thread, and their exceptions will be thrown here.

Advances the clock to t seconds, triggering side effects. Tasks are run
synchronously on this thread, and their exceptions will be thrown here.
sourceraw docstring

call-with-virtual-time!clj

(call-with-virtual-time! f)

Switches time functions to time.controlled counterparts, invokes f, then restores them. Definitely not threadsafe. Not safe by any standard, come to think of it. Only for testing purposes.

Switches time functions to time.controlled counterparts, invokes f,
then restores them. Definitely not threadsafe. Not safe by any standard,
come to think of it. Only for testing purposes.
sourceraw docstring

clockclj

Reference to the current time, in microseconds.

Reference to the current time, in microseconds.
sourceraw docstring

reset-clock!clj

(reset-clock!)
source

reset-time!clj

(reset-time!)
(reset-time! f)

Resets the clock and task queue. If a function is given, calls f after resetting the time and task list.

Resets the clock and task queue. If a function is given, calls f after
resetting the time and task list.
sourceraw docstring

set-time!clj

(set-time! t)

Sets the current time in seconds, without triggering callbacks.

Sets the current time in seconds, without triggering callbacks.
sourceraw docstring

virtual-linear-timeclj

(virtual-linear-time)
source

virtual-linear-time-microsclj

(virtual-linear-time-micros)
source

virtual-unix-timeclj

(virtual-unix-time)
source

virtual-unix-time-microsclj

(virtual-unix-time-micros)
source

with-virtual-time!cljmacro

(with-virtual-time! & body)

Switches time functions to virtual counterparts, evaluates body, and returns. Not at all threadsafe; bindings take effect globally. This is only for testing.

Switches time functions to virtual counterparts, evaluates body, and
returns. Not at all threadsafe; bindings take effect globally. This is only
for testing.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close