Replies: 1 comment
-
Try something like this import { formatDuration } from 'date-fns';
const duration = formatDuration({
hours: 0,
minutes: 0,
seconds: 35,
milliseconds: 123,
});
console.log(`The duration of scripts: ${duration}`); So the output will be
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is the output format i'm expecting
milliseconds => { hours, minutes, seconds, milliseconds }
so i can display
The duration of scripts: 0m 0s 35ms
Do we have a buildin function to do so in date-fns ?
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions