ID:138559
 
I have always used sleep(1) to mean "sleep til the next tick".

However, I noticed yesterday that the doc shows sleep to default to sleep(0), but it's not clear to me what that means.

Does sleep(0) mean "stop execution now and start again next tick", and sleep(1) mean "stop execution now and start again the tick after next"?

If so, I should go back and drop all my sleep commands by 1 tick...
Hmm... I *think* (0) and (1) are treated the same but I'm not sure.

Cut-n-paste-n-compile this for the answer! Unless I included a bug, of course, which is a fair bet. :)

mob
verb
test_sleep()
usr << "Initial time is [world.time]"
spawn NewSleep(0)
spawn NewSleep(1)
spawn NewSleep(2)

proc
NewSleep(myTime)
sleep(myTime)
usr << "Time after [myTime] is [world.time]"
In response to Guy T.
mob
verb
test_sleep(myTime as num)
usr << "Initial time is [world.time]"
sleep(myTime)
usr << "Final time is [world.time]"