Port timer script to JS

This commit is contained in:
Patrick Niklaus
2017-04-09 11:52:05 +00:00
committed by Patrick Niklaus
parent e162dda836
commit 2c001b63a5
4 changed files with 18 additions and 17 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env node
var exec = require('child_process').exec;
var fs = require('fs');
var name = process.argv[2];
var cmd = process.argv.slice(3).join(' ');
var start = +new Date();
exec(cmd, (err) => {
if (err) return console.log(err);
var stop = +new Date();
var time = (stop - start) / 1000.;
fs.appendFileSync('/tmp/osrm.timings', `${name}\t${time}`, 'utf-8')
})