rem: if (c > 500) { console.log("avg " + miss_c/c + "ms per frame (" + now_playing + ")"); 
add: if (c > 750) { console.log("avg " + Math.round(miss_c/c) + "ms per frame, frame rate needs " + (1000/FRAME_RATE)); 
context: function go() {  var d = (new Date).getTime();  miss_c+=d-next_frame;  next_frame = d+1000/FRAME_RATE;    c++;  if (now_playing[0][1] <= 0) {    now_playing.splice(0,1);  }  if (c > 500) {    console.log("avg " + miss_c/c + "ms per frame (" + now_playing + ")");    if (now_playing.length == 1) {      var keys = Object.keys(providers);      for (var p=0;p<now_playing.length;++p){        for (var k=0;k<keys.length;++k){          if (p[0] == keys[k]) {            keys.splice(k,1);          }        }      }      now_playing.push([keys[ keys.length * Math.random() << 0], 0]);    }    c=0;    miss_c=0;  }  if (now_playing.length > 1) {    now_playing[0][1]-=now_playing[0][1]<=0?0:1;    now_playing[1][1]+=now_playing[1][1]>=255?0:1;  }  var s;  try {    s = spectrum.getSpectrum();  } catch (x){    console.log("f: ");  }  if (s==undefined){    console.log("x:");    s=[0,0,0,0,0,0];  }  var volume = (s[0]+s[1]+s[2]+s[3]+s[4]+s[5]+s[6])/7;//  var v = providers['rainbow'].getFrame(s,volume);//  var v = providers['text'].getFrame(s,volume);//  var v = providers['image'].getFrame(s,volume);//  var v = providers['skulls'].getFrame(s,volume);//  var v = providers['plasma'].getFrame(s,volume);  for (var x = 0; x < 24;++x){    for (var y = 0; y < 6; y++){      for (var b = 0; b < 3; b++){        pixels[x][y][b] = 0;      }    }  }  var things = [['mario',255]];  things = now_playing;    for (var i = 0; i < things.length; ++i){    var v = providers[things[i][0]].getFrame(s,volume,s[7],s[8] > 0);    for (var x = 0; x < 24;++x){      for (var y = 0; y < 6;++y){        for (var b = 0; b < 3; ++b){          pixels[x][y][b] += v[x][y][b]*things[i][1]/255;        }        }    }  }    for (var x = 0; x < 24;++x){     for (var y = 0; y < 6;++y){       leds.setLed(x,y,pixels[x][y][0],pixels[x][y][1],pixels[x][y][2]); //      leds.setLed(x,y,v[x][y][0],v[x][y][1],v[x][y][2]);     }  }  leds.draw();  d = (new Date).getTime() - d;  setTimeout(go,(1000/FRAME_RATE)-d);  global.gc();}
meta: 7521	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/7521/b38d44f2e8e462eb149e6cd836bfa92e6bc885ff/core.js/clean/core.js