have a look in ProcessScheduler/test/testSlowProcess.dm

scheck within for loops check to see if the process should sleep to allow other shit to continue or not

If the current tick is lagging, scheck does sleep(1). if the current tick is not lagging, it does sleep(0).

read http://www.byond.com/forum/?post=1638359 for a very thorough explanation of sleep and spawn by the late great Ter13