1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-03-02 03:40:21 +00:00

resolves #8: show execution time of the running job

This commit is contained in:
Oliver Giles
2017-11-03 16:47:30 +02:00
parent 576159d8e9
commit 7d47bc4b89
2 changed files with 13 additions and 3 deletions

View File

@@ -67,6 +67,16 @@ const Utils = {
][d.getMonth()] + ' ' +
d.getFullYear();
},
formatDuration: function(start, end) {
if(!end)
end = Math.floor(Date.now()/1000);
if(end - start > 3600)
return Math.floor((end-start)/3600) + 'hours, ' + Math.floor(((end-start)%3600)/60) + ' minutes';
else if(end - start > 60)
return Math.floor((end-start)/60) + 'minutes, ' + ((end-start)%60) + ' seconds';
else
return (end-start) + ' seconds';
}
}
};