@oaklean/profiler
Version:
A library to measure the energy consumption of your javascript/typescript code
30 lines • 2.2 kB
JavaScript
;
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());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const html_minifier_1 = __importDefault(require("html-minifier"));
const index_1 = require("../src/index");
const profile = new index_1.Profiler('example002');
function main() {
return __awaiter(this, void 0, void 0, function* () {
const title = 'latest';
yield profile.start(title);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const result = html_minifier_1.default.minify('<style>* { font-size: 11px }</style><p title="blah" id="moo">foo</p>', {
minifyCSS: true
});
yield profile.finish(title);
});
}
main();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhhbXBsZTAwMi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL2V4YW1wbGVzL2V4YW1wbGUwMDIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7QUFBQSxrRUFBb0M7QUFFcEMsd0NBQXVDO0FBRXZDLE1BQU0sT0FBTyxHQUFHLElBQUksZ0JBQVEsQ0FBQyxZQUFZLENBQUMsQ0FBQTtBQUUxQyxTQUFlLElBQUk7O1FBQ2xCLE1BQU0sS0FBSyxHQUFHLFFBQVEsQ0FBQTtRQUN0QixNQUFNLE9BQU8sQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDLENBQUE7UUFDMUIsNkRBQTZEO1FBQzdELE1BQU0sTUFBTSxHQUFHLHVCQUFRLENBQUMsTUFBTSxDQUFDLHNFQUFzRSxFQUFFO1lBQ3RHLFNBQVMsRUFBRSxJQUFJO1NBQ2YsQ0FBQyxDQUFBO1FBRUYsTUFBTSxPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFBO0lBQzVCLENBQUM7Q0FBQTtBQUVELElBQUksRUFBRSxDQUFBIn0=