make it even more foolproof

This commit is contained in:
2016-08-20 08:29:18 +02:00
parent 4590c8f64e
commit ce76702d53
2 changed files with 15 additions and 5 deletions

View File

@ -39,8 +39,10 @@ export let start = function (moduleNameArg: string = "", loaderLengthArg: string
export let stop = function () {
let done = q.defer();
let endTime = process.hrtime(startTime);
let executionTime:string = (endTime[0] + (endTime[1] / 1000000000)).toString();
let endTime = function(){try{return process.hrtime(startTime)}catch(err){return [0,0]}}();;
let exTimeSeconds = endTime[0];
let exTimeMilliseconds = endTime[1] / 1000000000;
let executionTime:string = (exTimeSeconds + exTimeMilliseconds).toString();
if (doAnimation) {
earlyChild.kill("SIGINT");
earlyChild.on("close", function () {