Module: time.clock

Source: ./time/clock.reef


Overview

time/clock - Time and sleep functions

Provides functions for getting current time and sleeping. Uses C standard library functions wrapped for Reef.


Functions

fn now_seconds(): int

Returns current Unix timestamp in seconds since epoch (1970-01-01)

fn now_millis(): int

Returns current time in milliseconds since epoch

fn clock_ticks(): int

Returns CPU clock ticks (for measuring elapsed time)

fn ticks_per_second(): int

Returns number of clock ticks per second Use this to convert clock_ticks() to seconds


Procedures

proc sleep_seconds(s: int)

Pauses execution for specified number of seconds

proc sleep_millis(ms: int)

Pauses execution for specified number of milliseconds

proc sleep_micros(us: int)

Pauses execution for specified number of microseconds


Generated by reefc doc