Skip to content

Instantly share code, notes, and snippets.

View dsincl12's full-sized avatar

David Sinclair dsincl12

View GitHub Profile
var calculateElapsedTime = function (startTime, endTime) {
var milliseconds = endTime - startTime;
var seconds = Math.round(milliseconds / 1000);
var minutes = Math.floor(seconds / 60);
var hours = minutes > 59 ? Math.floor(minutes / 60) : 0;
if (minutes > 0) {
seconds -= minutes * 60;
}