mainloop iteration slept using wrong timer.