/**
 * Common duration constants, in milliseconds.
 */ "use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    Duration: function() {
        return Duration;
    },
    inMilliseconds: function() {
        return inMilliseconds;
    },
    timeSince: function() {
        return timeSince;
    }
});
var Duration;
(function(Duration) {
    Duration[Duration[/**
   * A millisecond.
   */ "Millisecond"] = 1] = "Millisecond";
    Duration[Duration[/**
   * A second, in milliseconds.
   */ "Second"] = 1000] = "Second";
    Duration[Duration[/**
   * A minute, in milliseconds.
   */ "Minute"] = 60000] = "Minute";
    Duration[Duration[/**
   * An hour, in milliseconds.
   */ "Hour"] = 3600000] = "Hour";
    Duration[Duration[/**
   * A day, in milliseconds.
   */ "Day"] = 86400000] = "Day";
    Duration[Duration[/**
   * A week, in milliseconds.
   */ "Week"] = 604800000] = "Week";
    Duration[Duration[/**
   * A year, in milliseconds.
   */ "Year"] = 31536000000] = "Year";
})(Duration || (Duration = {}));
const isNonNegativeInteger = (number)=>Number.isInteger(number) && number >= 0;
const assertIsNonNegativeInteger = (number, name)=>{
    if (!isNonNegativeInteger(number)) {
        throw new Error(`"${name}" must be a non-negative integer. Received: "${number}".`);
    }
};
function inMilliseconds(count, duration) {
    assertIsNonNegativeInteger(count, 'count');
    return count * duration;
}
function timeSince(timestamp) {
    assertIsNonNegativeInteger(timestamp, 'timestamp');
    return Date.now() - timestamp;
}

//# sourceMappingURL=time.js.map