Configure and run a benchmark to measure the performance of setTimeout() in your browser.
setTimeout()
in JavaScript isn’t perfectly accurate.
Since JS runs on a single thread, timers are queued in the event loop, and if the thread is busy, execution is delayed. Short timeouts and heavy workloads make this more noticeable. Browsers also enforce a minimum delay, so the callback may not run exactly when you expect.