From edf1b64624f1e4f12dfedd8838267309c2e26e51 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sat, 26 Oct 2024 22:24:54 +0200 Subject: [PATCH] Added more detailed total runtime. --- src/app.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app.js b/src/app.js index 926e3750..e2d04855 100755 --- a/src/app.js +++ b/src/app.js @@ -8,7 +8,7 @@ const unprint = require('unprint'); // const log = require('why-is-node-running'); const Inspector = require('inspector-api'); const fs = require('fs').promises; -const { format, formatDistanceStrict } = require('date-fns'); +const { format, intervalToDuration } = require('date-fns'); const argv = require('./argv'); const initServer = require('./web/server'); @@ -211,7 +211,10 @@ async function init() { await associateMovieScenes(storedMovies, [...storedScenes, ...storedMovieScenes]); } - logger.info(`Completed in ${formatDistanceStrict(new Date(), startTime)}`); + logger.info(`Completed in ${Object.entries(intervalToDuration({ start: startTime, end: Date.now() })) + .filter(([, value]) => value > 0) + .map(([key, value]) => `${value} ${key}`) + .join(', ')}`); } catch (error) { console.trace(error); logger.error(error);