UNPKG

es-node-runner

Version:

Node runner that transpiles typescript or es modules using blazing fast ⚡ esbuild and restarts the process automatically on change. Suitable for node development server.

16 lines (15 loc) 454 B
function formatElapsedTime(millisecond) { const timeInSeconds = millisecond / 1000; let time = ''; if (timeInSeconds >= 60) { let minutes = Math.floor(timeInSeconds / 60); if (minutes >= 60) { const hours = Math.floor(minutes / 60); minutes = Math.round(minutes % 60); time += `${hours} h `; } time += `${minutes} m `; } return time + `${Math.round(timeInSeconds % 60)} s`; } export default formatElapsedTime;