v.wait()
Use v.wait() when JavaScript must wait until GPU work is finished.
await v.wait(node);It submits work just like v.run(), then waits for completion.
Multiple Nodes
Section titled “Multiple Nodes”v.wait() also accepts an array.
await v.wait([A, B]);This is the waiting version of v.run([A, B]).
When to Use It
Section titled “When to Use It”Use v.wait() when:
- measuring GPU work
- coordinating with code that must run after the GPU is done
- debugging execution order
You do not need v.wait() before v.read(). Reading data already waits for the readback it needs.