"use strict";
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.Time = void 0;
const InvalidTimeUnits_1 = require("./error/InvalidTimeUnits");
class Time {
    static delay(time, unit) {
        let delayInMilliseconds;
        if (unit === "seconds" || unit === "sec") {
            delayInMilliseconds = time * 1000;
        }
        else if (unit === "milliseconds" || unit === "ms") {
            delayInMilliseconds = time;
        }
        else {
            throw new InvalidTimeUnits_1.InvalidTimeUnits();
        }
        return new Promise((resolve) => setTimeout(() => resolve(true), delayInMilliseconds));
    }
}
exports.Time = Time;
