/**
 * Common duration constants, in milliseconds.
 */ export 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}".`);
    }
};
/**
 * Calculates the millisecond value of the specified number of units of time.
 *
 * @param count - The number of units of time.
 * @param duration - The unit of time to count.
 * @returns The count multiplied by the specified duration.
 */ export function inMilliseconds(count, duration) {
    assertIsNonNegativeInteger(count, 'count');
    return count * duration;
}
/**
 * Gets the milliseconds since a particular Unix epoch timestamp.
 *
 * @param timestamp - A Unix millisecond timestamp.
 * @returns The number of milliseconds elapsed since the specified timestamp.
 */ export function timeSince(timestamp) {
    assertIsNonNegativeInteger(timestamp, 'timestamp');
    return Date.now() - timestamp;
}

//# sourceMappingURL=time.js.map