clockblocks.utilities.wait_until

clockblocks.utilities.wait_until(when: float | ResolvableMoment, units='beats') → None[source]

Block the clock currently active on this thread until the absolute beat (or time, if units="time") given by when. Forwards to wait_until().

when may also be a Moment or MetricPhaseTarget, in which case the units are ignored and behavior is identical to wait(). If when is already in the past, this returns essentially immediately.

On a thread with no active clock, raises NoActiveClockError.

Parameters:
  • when – the absolute beat (or time, if units="time") to wait until, or a Moment / MetricPhaseTarget to resolve.

  • units – either "beats" or "time" (ignored when when is a Moment).