scheduler: mainloop timing optimized