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:
@@ -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';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user