-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.js
1 lines (1 loc) · 2.17 KB
/
global.js
1
var perfect=function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=0)}([function(a,b,c){'use strict';Object.defineProperty(b,'__esModule',{value:!0}),function(a){function d(a,b,c,d){var e=d.setup,g=d.before,h=d.test,j=d.after,k=d.cleanup;if(!h)throw new Error('Um, you need a test.');var l,m,n,o={},p=0;c&&console.log(' -- TEST CASE: "'+a+'" -- '),e&&e.call(o,o);for(var q=0;q<b;q+=1){g&&g.call(o,o);var i=function(){return m=f.now()},r=function(){return n=f.now()},s=f.now();h.call(o,i,r,o),n=n||f.now(),m=m||s,p+=n-m,j&&j.call(o,o)}return k&&k.call(o,o),l=p/b,c&&(console.log(' - total time: '+p),console.log(' - average time: '+l)),{name:a,totalTime:p,averageTime:l}}b.performanceTest=function(a){var b=a.description,c=a.testCases,e=a.iterations,f=a.logResults;e=e||5e5;var g=[];for(var h in f&&(console.log(' --- PERFORMANCE TEST: "'+b+'"'),console.log(' -- RUNNING... ')),c)g.push(d(h,e,f,c[h]));for(var j,k=g[0],l=g[0],m=0,i=g;m<i.length;m+=1)j=i[m],j.averageTime>k.averageTime&&(k=j),j.averageTime<l.averageTime&&(l=j);return f&&(console.log(' -- DONE! Results: '),console.log(' -- SLOWEST: "'+k.name+'"'),console.log(' - total time: '+k.totalTime),console.log(' - average time: '+k.averageTime),console.log(' -- FASTEST: "'+l.name+'"'),console.log(' - total time: '+l.totalTime),console.log(' - average time: '+l.averageTime)),{slowest:k,fastest:l}},c.d(b,'version',function(){return g});var e;try{e=(42,eval)('this')}catch(b){e='object'==typeof window?window:a||{}}var f='undefined'!=typeof e.performance&&e.performance.now?e.performance:{now:Date.now.bind(Date)},g='1.1.0'}.call(b,c(1))},function(a){var b=function(){return this}();try{b=b||Function('return this')()||(1,eval)('this')}catch(a){'object'==typeof window&&(b=window)}a.exports=b}]);