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

method clock.advance

Moves virtual time forward, running everything that falls due on the way (messages, timers, scheduled faults).

Example:

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

test sim "advance moves the clock" seeds 1..=2 {
  let t0 = now()
  clock.advance(1h)
  assert now() - t0 == 1h
}
pub(api) static fn advance(d: Dur)

С версии. 1.0.0-beta

Параметры

ИмяТип
dDur

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/test/test.oxl:314

См. также