MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / time

Function time

code/solutions/22_2_timing.js:14–19  ·  view source on GitHub ↗
(findPath)

Source from the content-addressed store, hash-verified

12}
13
14function time(findPath) {
15 let graph = treeGraph(6, 6);
16 let startTime = Date.now();
17 let result = findPath(graph[0], graph[graph.length - 1]);
18 console.log(`Path with length ${result.length} found in ${Date.now() - startTime}ms`);
19}
20time(findPath);

Callers 1

22_2_timing.jsFile · 0.70

Calls 1

findPathFunction · 0.70

Tested by

no test coverage detected