OxL Справочник OxL
РусскийEnglish

data Instant

Monotonic clock reading, for measurements only (§17.1).

Example:

oxl✓ проверяется в CI
use std.time { Instant }

fn main() io, time {
  let t0 = Instant.now()
  let spent = t0.elapsed()
  print("{spent.isNegative()}")
}
Вывод
false
@builtin("Instant") pub(api) data Instant

Потокобезопасность. an immutable value; readings of different tasks are comparable.

С версии. 1.0.0-beta

Определено в: std/core/types.oxl:131

См. также