You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • The idea behind speedy is slightly different.
    forEach is running with one callbackFn only.
    Idea is to combine different functions with a default function.
    Thats close to your changes to shiftOut.
    in this example we combine a simple console.log with pin.set/reset

    function fill(){
      arr = [];
      arr.push({callback:en.reset.bind(en)});
      arr.push({callback:console.log.bind(cons­ole,"qwertz\n")});
      arr.push({callback:en.set.bind(en)});
      arr.push({callback:console.log.bind(cons­ole,"asdf\n")});
      arr.push([1,3,5]);
      arr.push("abc");
    }
    
    x = console.log.bind(console,"z:");
    function speed(n){
      fill();
      if(!n) n = 100;
      var t = getTime();
      for(var i = 0; i < n; i++) E.speedy(x,arr);
      console.log(getTime() -t);
    }
    
    

    I would not say, this is standard Javascript ;-), it could be helpful, but is it worth it ?

About

Avatar for JumJum @JumJum started