Skip to content

Instantly share code, notes, and snippets.

@camerican
Created September 28, 2017 20:34
Show Gist options
  • Save camerican/2b0db459f8e8064645c150a693b37478 to your computer and use it in GitHub Desktop.
Save camerican/2b0db459f8e8064645c150a693b37478 to your computer and use it in GitHub Desktop.
Utility functions
//convert duration from milliseconds to human-readable Minute:SS display:
function convertDuration(duration){
let seconds = Math.ceil(duration / 1000);
return parseInt(seconds/60) + ":" + ("0"+seconds%60).slice(-2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment