Clicks feel slow
Try the counter while a five-second calculation runs.
All speed examples · Reload this example
Try clicking while work runs
Ready.
What changed?
The five-second calculation runs in a Web Worker. The main thread remains available for clicks, typing and painting. The same timed work runs in both versions. A worker helps suitable CPU work; reducing unnecessary work or splitting tasks may be the better fix elsewhere.