"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.formatTime = void 0;

/*
Copyright (c) Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
function padTo2Digits(num) {
  return num.toString().padStart(2, '0');
}

var formatTime = function formatTime(totalMilliseconds) {
  var totalSeconds = Math.floor(totalMilliseconds / 1000); // If there are remaining milliseconds, consider it as an extra second.

  if (totalMilliseconds % 1000 > 0) {
    totalSeconds += 1;
  }

  var minutes = Math.floor(totalSeconds / 60);
  var seconds = Math.floor(totalSeconds % 60);
  return "".concat(minutes, ":").concat(padTo2Digits(seconds));
};

exports.formatTime = formatTime;