(implementation, graph)
| 74 | } |
| 75 | |
| 76 | async function runLayout(implementation, graph) { |
| 77 | let time = 0, iterations = 0; |
| 78 | let layout = randomLayout(graph); |
| 79 | while (time < 3000) { |
| 80 | let start = Date.now(); |
| 81 | for (let i = 0; i < 100; i++) { |
| 82 | implementation(layout, graph); |
| 83 | iterations++; |
| 84 | } |
| 85 | time += Date.now() - start; |
| 86 | drawGraph(graph, layout); |
| 87 | await pause(); |
| 88 | } |
| 89 | let perSecond = Math.round(iterations / (time / 1000)); |
| 90 | console.log(`${perSecond} iterations per second`); |
| 91 | } |
| 92 | |
| 93 | function forceDirected_noRepeat(layout, graph) { |
| 94 | for (let a = 0; a < graph.size; a++) { |
nothing calls this directly
no test coverage detected