fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

run_periodic

time.Clock.run_periodic

run the given `code` periodically at time `first+p*0`, `first+p*1`, `first+p*2`,
etc. until this clock has reached the time `last`.

In case any of the instants `first+p*0`, `first+p*1`, `first+p*2`, etc. happen to
be in the past when this is called or after the previous execution of `code`,
respectively, do not run `code` for that instant.

In case `period.is_infinity`, run `code` once unless `first > last`.
Precondition
pre
  debug: p.is_infinity || p.as_duration > time.duration.ns 0

Type Parameters

P:time.period[src]

Arguments

first time.instant[src]
p P[src]
last time.instant[src]
code Function unit[src]
0.099dev (GIT hash e2d5298d8107bb5fe79600fdb06a49bc75756344)
last changed: 2026-11-23