1 export const formatTime = result => {
2 const hours = `${Math.floor(result.time / 60 / 60)}`;
3 let minutes = `${Math.floor((result.time / 60) % 60)}`;
4 let seconds = `${Math.floor(result.time % 60)}`;
5 while (minutes.length < 2) {
6 minutes = `0${minutes}`;
8 while (seconds.length < 2) {
9 seconds = `0${seconds}`;
11 return `${hours}:${minutes}:${seconds}`;