tur/time

stdlib/time.tur
defn

Real-Time

(Real-Time)

create a wall-clock Time capability backed by libc time().

Since: Phase 16

defn

Real-Time-free

(Real-Time-free [t])

release a Time capability created by Real-Time.

tthe Time pointer returned by Real-Time.

Since: Phase 16

defn

HighRes-Time

(HighRes-Time)

create a CPU-clock Time capability backed by clock().

Since: Phase 16

defn

HighRes-Time-free

(HighRes-Time-free [t])

release a Time capability created by HighRes-Time.

tthe Time pointer returned by HighRes-Time.

Since: Phase 16

defn

Mock-Time

(Mock-Time)

create a controllable Time capability for testing.

Since: Phase 16

defn

Mock-Time-free

(Mock-Time-free [t])

release a Time capability created by Mock-Time.

tthe Time pointer returned by Mock-Time.

Since: Phase 16

defn

mock-time-set

(mock-time-set [t new_time])

set the current time on a Mock-Time instance.

tthe Mock-Time pointer.
new_timethe new time value in milliseconds.

Since: Phase 16

defn

mock-time-get

(mock-time-get [t])

read the current time from a Mock-Time instance.

tthe Mock-Time pointer.

Since: Phase 16

defn

get-time-ms

(get-time-ms)

return the current wall-clock time in milliseconds since epoch.

Since: Phase 16

defn

sleep-ms

(sleep-ms [ms])

suspend execution for a given number of milliseconds.

msnumber of milliseconds to sleep (no-op if <= 0).

Since: Phase 16

defn

get-cpu-time

(get-cpu-time)

return the current process CPU time in milliseconds.

Since: Phase 16