Skip to content

Instantly share code, notes, and snippets.

View andreialecu's full-sized avatar

Andrei Alecu andreialecu

View GitHub Profile
var vm = require('vm'),
code = 'var square = n * n;',
fn = new Function('n', code),
script = vm.createScript(code),
sandbox;
n = 5;
sandbox = { n: n };
benchmark = function(title, funk) {