clockblocks.utilities.wait

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

Block the clock currently active on this thread for dt beats (or seconds, if units="time"), yielding to the scheduler. Forwards to wait().

dt may also be a Moment or MetricPhaseTarget, in which case it is resolved directly and units is ignored — e.g. wait(Moment.at_beat(8)).

On a thread with no active clock, raises NoActiveClockError.

Parameters:
  • dt – how long to wait — a number (in beats, or seconds if units="time"), or a Moment / MetricPhaseTarget to wait until.

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