"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const HotLog_js_1 = require("../src/HotLog.js");
const HotPage_js_1 = require("../src/HotPage.js");
const HotStaq_js_1 = require("../src/HotStaq.js");
const HotFile_js_1 = require("./HotFile.js");
function runTest(testName, func, logger) {
    return __awaiter(this, void 0, void 0, function* () {
        let processor = new HotStaq_js_1.HotStaq();
        processor.logger = logger;
        let page = new HotPage_js_1.HotPage(processor);
        const t0 = performance.now();
        logger.info(`Running benchmarks for "${testName}"...`);
        yield func(processor, page);
        const delta = (performance.now() - t0);
        logger.info(`Finished running benchmarks for "${testName}". Time taken: ${delta.toFixed(2)} ms`);
    });
}
function main() {
    return __awaiter(this, void 0, void 0, function* () {
        let logger = new HotLog_js_1.HotLog();
        logger.info("Starting benchmarks...");
        yield runTest("HotFile", HotFile_js_1.start, logger);
        logger.info("Finished benchmarks!");
    });
}
main();
//# sourceMappingURL=index.js.map