Runs a callable until a timeout is reached:
declare(ticks = 1);
Code::run(function(){
sleep(100);
}, 10);
Runs a callable in loop until a timeout is reached and the return value is false
:
// declare(ticks = 1); is optionnal when the callable is not blocking on spinning mode
Code::spin(function(){
sleep(1);
return false;
}, 10);