0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
nodejs/benchmark/v8_bench.js
2011-02-14 17:26:54 -08:00

16 lines
374 B
JavaScript

// compare with "google-chrome deps/v8/benchmarks/run.html"
var fs = require('fs');
var path = require('path');
var vm = require('vm');
var dir = path.join(__dirname, '..', 'deps', 'v8', 'benchmarks');
global.print = console.log;
global.load = function (x) {
var source = fs.readFileSync(path.join(dir, x), 'utf8');
vm.runInThisContext(source, x);
}
load('run.js');