MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / measureMemory

Function measureMemory

test/compute-engine/compile-performance.test.ts:37–45  ·  view source on GitHub ↗
(fn: () => any)

Source from the content-addressed store, hash-verified

35 process.env.COMPILE_PERF_VERBOSE === '1' ||
36 process.env.BENCH_VERBOSE === '1' ||
37 process.env.VERBOSE === '1';
38 const log = (...args: unknown[]) => {
39 if (verbose) {
40 console.log(...args);
41 }
42 };
43 // Helper to measure execution time
44 function benchmark(fn: () => any, iterations: number): number {
45 const start = performance.now();
46 for (let i = 0; i < iterations; i++) {
47 fn();
48 }

Callers 1

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected