coil-time

Userland calendar and monotonic time for coil. Process clocks (wall_nanos, mono_nanos, sleep_ms) are HostInvoke via virtual clock. This package is calendar, Instant snapshots, and format/parse. There is no cdylib.

The sixteen names in src/time.hy are timestamp, sleep_ms, instant_now, elapsed_nanos, elapsed_millis, period, add, sub, period_add, period_sub, date, date_from_period, date_from_epoch_period, epoch, format, and parse. Instant adds drop so a snapshot can be marked dead. Elapsed after drop is TimeError::InvalidInput.

RFC presets are named helpers (format_rfc3339 / parse_rfc3339, format_iso8601 / parse_iso8601, format_iso8601_date / parse_iso8601_date, format_rfc2822 / parse_rfc2822, format_http_date / parse_http_date). The documented format / parse patterns are %Y-%m-%d (ISO date) and %Y-%m-%dT%H:%M:%S (date-time body, no zone).

Layout#

PathRole
src/time.hyPackage exports (timestamp, period, Instant.drop, …)
coil.toml[package] name = "time"

use clock::{wall_nanos, mono_nanos, sleep_ms} is the host edge. Instant is a Coil int mono snapshot plus a live flag. elapsed_* is mono_now - start in Coil.

Needs coil-lang archive 4.4 (HostInvoke ids 121–123).

Build#

make test     # coil tests (no native artifact)

Coil tests need coil on PATH (coil-lang default features are empty):

# sibling coil-lang (main, archive 4.4+)
cargo build -p coil
make test COIL=../coil-lang/target/debug/coil

Consume with spool add time --git https://github.com/ardax-corp/coil-time.git --rev <commit SHA> (no tags yet), or a sibling checkout plus --root ../coil-time/src. See docs/consume.md.

License#

MIT. See LICENSE.

Synced from coil-time/README.md . Edit it there; changes reach this site on the next package sync.

↑ ↓ navigate ↵ open