MCPcopy Create free account
hub / github.com/braziljs/eloquente-javascript / time

Function time

code/solutions/22_3_optimizing.js:1–6  ·  view source on GitHub ↗
(findPath)

Source from the content-addressed store, hash-verified

1function time(findPath) {
2 let graph = treeGraph(6, 6);
3 let startTime = Date.now();
4 let result = findPath(graph[0], graph[graph.length - 1]);
5 console.log(`Path with length ${result.length} found in ${Date.now() - startTime}ms`);
6}
7
8function findPath_set(a, b) {
9 let work = [[a]];

Callers 1

22_3_optimizing.jsFile · 0.70

Calls 1

findPathFunction · 0.70

Tested by

no test coverage detected