decord/source/module_13853.js

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 13853
// Function ID: 13854
2026-08-13 17:34:28 +00:00
// Dependencies: []
2026-08-24 06:08:38 +00:00
// Module 13853
2026-08-13 17:34:28 +00:00
arg5.default = () => (startTimer) => {
2026-08-24 06:08:38 +00:00
closure_0 = startTimer;
2026-08-13 17:34:28 +00:00
startTimer = startTimer.startTimer;
const features = {
benchmark(title) {
2026-08-24 06:08:38 +00:00
closure_0 = title;
2026-08-13 17:34:28 +00:00
const items = [];
2026-08-24 06:08:38 +00:00
closure_2 = items();
2026-08-13 17:34:28 +00:00
function step(title) {
let arr = items;
let num = 0;
if (0 !== items.length) {
num = arr[arr.length - 1].time;
}
const tmp = callback();
arr = arr.push({ title, time: tmp, delta: tmp - num });
}
items.push({ title, time: 0, delta: 0 });
function stop(title) {
if (typeof step !== "function") {
HermesBuiltin.throwTypeError();
}
let arr = items;
let num = 0;
if (0 !== items.length) {
num = arr[arr.length - 1].time;
}
const tmp = callback();
let obj = { title, time: tmp, delta: tmp - num };
arr = arr.push(obj);
obj = { title, steps: arr };
title.send("benchmark.report", obj);
}
return { step, stop, last: stop };
}
};
return { features };
};