block_slept? ()
Given a block, runs it and returns whether or not the block contained sleeps or syncs
Introduced in v2.9
slept = block_slept? do play 50 sleep 1 play 62 sleep 2 end puts slept
#=> Returns true as there were sleeps in the block
in_thread do sleep 1 cue :foo end slept = block_slept? do sync :foo play 62 end puts slept
# trigger a cue on a different thread # wait for the cue before playing the note #=> Returns true as the block contained a sync.
slept = block_slept? do play 50 play 62 end puts slept
#=> Returns false as there were no sleeps in the block