MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / time

Function time

__tests__/objcpp-cpp-items.test.ts:609–617  ·  view source on GitHub ↗
(source: string)

Source from the content-addressed store, hash-verified

607
608 it('takes a file of sixteen thousand items in the time its size asks for', () => {
609 const time = (source: string): number => {
610 let best = Infinity;
611 for (let round = 0; round < 3; round++) {
612 const started = performance.now();
613 expect(splitObjcpp(source)!.items.length).toBeGreaterThan(1000);
614 best = Math.min(best, performance.now() - started);
615 }
616 return best;
617 };
618 const small = time(bigFile(1024 * 1024).text);
619 const large = time(bigFile(4 * 1024 * 1024).text);
620 // Four times the size is about four times the time; the square would be sixteen.

Callers 1

Calls 1

splitObjcppFunction · 0.90

Tested by

no test coverage detected