Relevant documentation - http://support.screeps.com/hc/en-us/articles/204825672-New-main-loop-architecture