Bringing setTimeout to ECMAScript

Breton Slivka zen at zenpsycho.com
Sat Mar 19 06:49:51 PDT 2011


never write code on no sleep.

that code sample should be :

 timers= (function () {
     var timers = [];
     var id=0;
     timer=function (f,t) {
          timers.push({func:f, interval:t, id:id++});
          return id;
     }
    return timers;
 })

 runScript("env.js");
 runScript("program.js");
 ev=getEvents();
while (!programHasQuit()) {

 handleEvents(timers,ev);

}


More information about the es-discuss mailing list