Skip to content

stdlib/timeView source ↗

time

7 items · generated by scribe fromstdlib/time.fd· synced 2026-11-15

stdlib/time7 items

Contents

LogicalTime

A logical point in time. Internally stored as Unix seconds (i64). All operations are deterministic — no system clock, no timezones.

pub struct LogicalTime {

Fields:

NameType
secondsi64

Defined at line 19


clock_now_ns

Get the current wall-clock time in nanoseconds since Unix epoch. NOT deterministic — use for profiling only.

pub fn clock_now_ns() -> i64 {

Returns: i64

Defined at line 490


clock_now_us

Get the current wall-clock time in microseconds since Unix epoch. NOT deterministic — use for profiling only.

pub fn clock_now_us() -> i64 {

Returns: i64

Defined at line 496


clock_now_ms

Get the current wall-clock time in milliseconds since Unix epoch. NOT deterministic — use for profiling only.

Example: var a = clock_now_ms(); var b = clock_now_ms(); assert(a > 0); assert(b >= a);

pub fn clock_now_ms() -> i64 {

Returns: i64

Defined at line 508


clock_elapsed_ns

Measure elapsed time in nanoseconds between two clock readings. Usage: value start = clock_now_ns(); …work…; value elapsed = clock_elapsed_ns(start);

Example: var start = clock_now_ns(); var e = clock_elapsed_ns(start); assert(e >= 0);

pub fn clock_elapsed_ns(start: i64) -> i64 {

Parameters:

  • start: i64

Returns: i64

Defined at line 519


clock_elapsed_us

Measure elapsed time in microseconds between two clock readings.

pub fn clock_elapsed_us(start: i64) -> i64 {

Parameters:

  • start: i64

Returns: i64

Defined at line 524


clock_elapsed_ms

Measure elapsed time in milliseconds between two clock readings.

pub fn clock_elapsed_ms(start: i64) -> i64 {

Parameters:

  • start: i64

Returns: i64

Defined at line 529


Generated by scribe, the Fides documentation generator