A very simple scheduler for Javascript code