Innovenergy_trunk/frontend/node_modules/testcafe/lib/utils/guard-time-execution.js

12 lines
1.5 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function guardTimeExecution(fn, onElapsed) {
const timeElapsedStart = process.hrtime();
const result = await fn();
const timeElapsedFinish = process.hrtime(timeElapsedStart);
onElapsed(timeElapsedFinish);
return result;
}
exports.default = guardTimeExecution;
module.exports = exports.default;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3VhcmQtdGltZS1leGVjdXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvZ3VhcmQtdGltZS1leGVjdXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBZSxLQUFLLFVBQVUsa0JBQWtCLENBQzVDLEVBQW9CLEVBQ3BCLFNBQWtEO0lBRWxELE1BQU0sZ0JBQWdCLEdBQUksT0FBTyxDQUFDLE1BQU0sRUFBRSxDQUFDO0lBQzNDLE1BQU0sTUFBTSxHQUFjLE1BQU0sRUFBRSxFQUFFLENBQUM7SUFDckMsTUFBTSxpQkFBaUIsR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLGdCQUFnQixDQUFDLENBQUM7SUFFM0QsU0FBUyxDQUFDLGlCQUFpQixDQUFDLENBQUM7SUFFN0IsT0FBTyxNQUFNLENBQUM7QUFDbEIsQ0FBQztBQVhELHFDQVdDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgYXN5bmMgZnVuY3Rpb24gZ3VhcmRUaW1lRXhlY3V0aW9uPFQ+IChcbiAgICBmbjogKCkgPT4gUHJvbWlzZTxUPixcbiAgICBvbkVsYXBzZWQ6IChlbGFwc2VkVGltZTogW251bWJlciwgbnVtYmVyXSkgPT4gdm9pZFxuKTogUHJvbWlzZTxUPiB7XG4gICAgY29uc3QgdGltZUVsYXBzZWRTdGFydCAgPSBwcm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