|
@ -1,16 +1,17 @@ |
|
|
libDir = process.path.join(process.path.dirname(__filename), "../lib"); |
|
|
var path = require("path"); |
|
|
|
|
|
libDir = path.join(path.dirname(__filename), "../lib"); |
|
|
require.paths.unshift(libDir); |
|
|
require.paths.unshift(libDir); |
|
|
process.mixin(require("/utils.js")); |
|
|
process.mixin(require("sys")); |
|
|
var benchmarks = [ "static_http_server.js" |
|
|
var benchmarks = [ "static_http_server.js" |
|
|
, "timers.js" |
|
|
, "timers.js" |
|
|
, "process_loop.js" |
|
|
, "process_loop.js" |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
var benchmark_dir = process.path.dirname(__filename); |
|
|
var benchmark_dir = path.dirname(__filename); |
|
|
|
|
|
|
|
|
function exec (script, callback) { |
|
|
function exec (script, callback) { |
|
|
var start = new Date(); |
|
|
var start = new Date(); |
|
|
var child = process.createChildProcess(process.ARGV[0], [process.path.join(benchmark_dir, script)]); |
|
|
var child = process.createChildProcess(process.ARGV[0], [path.join(benchmark_dir, script)]); |
|
|
child.addListener("exit", function (code) { |
|
|
child.addListener("exit", function (code) { |
|
|
var elapsed = new Date() - start; |
|
|
var elapsed = new Date() - start; |
|
|
callback(elapsed, code); |
|
|
callback(elapsed, code); |
|
|