ID:803458
 
(See the best response by Kaiochao.)
Problem description:

the title says it all, how to make a loop without spending much CPU I once created them that way but I was bringing a lot of problems

Code:
mob
proc
Tiempo_Jugado()
PlayTime+=1
sleep(10)
Tiempo_Jugado()


after I started using this other form


Code:
mob
proc
Tiempo_Jugado()
spawn() while(TRUE)
PlayTime+=1


could someone explain to me the best way to create a loop?
Best response
A delay of at least world.tick_lag (default = 1) is required for the game to not freeze.
mob
proc
Tiempo_Jugado()
spawn while(1)
sleep(world.tick_lag)
PlayTime ++