JS: sleep without setTimeout()