Method 1
WorldEvent()
while(1)
sleep(18000)
// execute some code
Method 2
WorldEvent()
sleep(18000)
// execute some code
spawn()
WorldEvent()
Method 3
WorldEvent()
for()
sleep(18000)
// execute some code
Method 4
world.New()
..()
spawn()
while(1)
sleep(18000)
// execute some code
Method 5
world.New()
..()
spawn(18000)
WorldEvent()
WorldEvent()
spawn(18000)
WorldEvent()
// execute some code
My preferred method is #5 for a very specific reason. Even though you have to duplicate the time in two locations (could be solved with a var/#define), it provides one clear benefit over other methods. If any of the other methods receive a runtime error they will immediately die, and the method will never be executed again. With method #5, this doesn't happen, because the timer for the next iteration is always kicked off before any errors can occur.
Let's say you had a loop with some kind of reference to a mob's client in a multiplayer game. If this player disconnects and you have a deadlinked mob, if you haven't accounted for this error then it will crash your procedure. In this way, method #5 protects you against most "oops, I missed that" programming errors that you can make - therefore this is very useful for early testing phases of a game. As for efficiency, I've never seen any compelling reason to switch it unless a loop is going off once a tick or similarly fast.
What are your thoughts?
~Polatrite~
That leaves you with for() and while(), and because you want an infinite loop that has no condition to keep on going based on, and only for() supports conditionless loops, that leaves for() as the best choice. (Of course, you can work around while() requiring a condition by giving it a dummy, constantly-true condition to pointlessly check every iteration, but that's a workaround versus a feature that naturally allows what you want.)