babel-plugin-jsperf
v0.0.2
Published
jsperf plugin aims to provide an easy way to benchmark javascript code
Downloads
14
Maintainers
Readme
babel-plugin-tester
Installation
npm install --save-dev babel-plugin-jsperf
Usage
Examples
// jsperf
function todo() {
console.log('toto');
}
↓ ↓ ↓ ↓ ↓ ↓
// jsperf
function todo() {
console.time('todo');
console.log('toto');
console.timeEnd('todo');
}
const foo = /* jsperf */ () => 'test';
↓ ↓ ↓ ↓ ↓ ↓
const foo = /* jsperf */function () {
console.time('foo');
var _returnValue = 'test';
console.timeEnd('foo');
return _returnValue;
};
class clazz {
// jsperf
method() {
console.log('class method !');
}
}
↓ ↓ ↓ ↓ ↓ ↓
class clazz {
// jsperf
method() {
console.time('function2');
console.log('class method !');
console.timeEnd('function2');
}
}
// jsperf
function foo() {
const bar = 'bar';
return bar;
}
↓ ↓ ↓ ↓ ↓ ↓
// jsperf
function foo() {
console.time('foo');
const bar = 'bar';
var _returnValue = bar;
console.timeEnd('foo');
return _returnValue;
}