console-extras.js
console-extras.js copied to clipboard
console.__getCallID is too slow
I used this lib to degug three.js project, works nice!, but i realized that getCallID make a FPSs drops significantly. I solve temporarily this adding a manual id argument, in this way: (surely there is a better way)
console.times = function (n, id) { var ret = Object.create(limited); ret.__id = this.__id || id || console.__getCallID(1); ret.__limit = n; ret.__throttle = this.__throttle || 0; return ret; }; console.times.consoleExtras = true; console.throttle = function (time, id) { var ret = Object.create(limited); ret.__id = this.__id || id || console.__getCallID(1); ret.__limit = this.__limit || Infinity; ret.__throttle = time; return ret; }; console.throttle.consoleExtras = true;