Monitor Refresh Rate, VSync & Browser FPS: The Technical Performance Guide
Monitor refresh rate (measured in Hertz, Hz) denotes the number of complete frames a physical display panel draws per second (e.g. 60Hz = 16.6ms per frame; 144Hz = 6.94ms; 240Hz = 4.16ms). In web browsers, the window.requestAnimationFrame() loop synchronizes directly to the display's vertical synchronization (VSync) clock, delivering silky motion on high-refresh rate displays while capping frame rates to prevent screen tearing.
Step 1: The Mathematics of Frame Budgets: 60Hz vs 144Hz vs 240Hz
Every increase in refresh rate shrinks your JavaScript execution budget per frame. At 60Hz, you have 16.6ms to execute script, style, and layout. At 144Hz, that window plummets to 6.94ms; at 240Hz, you have only 4.16ms before causing frame drops.
// Frame Render Windows:
// 60 Hz = 1000ms / 60 = 16.66 ms frame budget
// 120 Hz = 1000ms / 120 = 8.33 ms frame budget
// 144 Hz = 1000ms / 144 = 6.94 ms frame budget
// 240 Hz = 1000ms / 240 = 4.16 ms frame budget
// 360 Hz = 1000ms / 360 = 2.77 ms frame budget
Step 2: Benchmarking Display Hz via requestAnimationFrame
Browsers do not expose a direct screen.refreshRate API. Instead, measure high-resolution timestamps passed into requestAnimationFrame(timestamp) over 60–120 consecutive frames to compute the exact hardware refresh rate.
let frameTimes = [];
let lastTimestamp = null;
function measureHz(timestamp) {
if (lastTimestamp !== null) {
const delta = timestamp - lastTimestamp;
frameTimes.push(delta);
if (frameTimes.length > 60) {
frameTimes.shift();
const avgDelta = frameTimes.reduce((a, b) => a + b) / frameTimes.length;
const detectedHz = Math.round(1000 / avgDelta);
console.log(`Detected Display Refresh Rate: ${detectedHz} Hz (${avgDelta.toFixed(2)}ms)`);
}
}
lastTimestamp = timestamp;
requestAnimationFrame(measureHz);
}
requestAnimationFrame(measureHz);
Step 3: VSync Lock & Why Browsers Eliminate Screen Tearing
Unlike video games which can disable VSync for lower latency (causing horizontal screen tearing), web browsers enforce VSync compositing. Browsers composite the DOM buffer into memory and wait for the monitor scanout pulse before swapping buffers.
<!-- Browser VSync Render Loop -->
[ VSync Signal Received from Monitor Hardware ]
↓
[ Execute requestAnimationFrame Callbacks ]
↓
[ Recalculate Styles & Layout (Reflow) ]
↓
[ Paint & Commit Layers to GPU ]
↓
[ Wait for Next VSync Scanout ] (Zero Screen Tearing)
Step 4: Designing Ultra-Smooth 144Hz CSS Animations
To take advantage of high-refresh rate displays, always write animations using standard CSS transitions or Web Animations API (WAAPI). Avoid manual setInterval(fn, 16) timers, which lock your application to a choppy 60Hz cadence.
/* Runs at native 120Hz/144Hz/240Hz on capable hardware */
.smooth-glide {
transform: translate3d(var(--x), 0, 0);
transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
will-change: transform;
}
Next-Level Addons: Elevating Your Implementation
Take this technique further by combining it with complementary design token studios and animation tools:
When building high-performance UI animations or particle systems, my golden rule is: never calculate layout triggers (like getBoundingClientRect() or offsetHeight) inside animation loops. Read measurements once upfront and use CSS transforms or Canvas for buttery 60fps.
Frequently Asked Questions
Practical answers to common implementation questions, browser quirks, and performance tips.
Why does requestAnimationFrame fire at 144Hz on my monitor instead of 60Hz?
The `requestAnimationFrame` API is locked to your monitor's physical VSync refresh rate. On a 144Hz monitor, `rAF` callbacks fire every ~6.9ms (144 times per second), delivering ultra-smooth motion.
Why do browsers not have screen tearing like video games?
Browsers use composited window managers (like Desktop Window Manager on Windows or Quartz on macOS) with triple-buffering. New frames are only displayed during the monitor's vertical blanking interval (VBlank), preventing tearing.
Can browser extensions or background tabs throttle my refresh rate?
Yes. To save laptop battery, browsers automatically throttle background tabs to 1Hz or pause `requestAnimationFrame` entirely when a tab is minimized or hidden.
What causes dropped frames (stutter) on a 144Hz or 240Hz display?
If any JavaScript task takes longer than the frame budget (e.g. >6.94ms at 144Hz), the browser misses the VSync deadline and must repeat the previous frame, creating a visual stutter (jank).
Does CSS animation performance scale automatically to high-refresh displays?
Yes! Declarative CSS transitions and keyframes run on the browser compositor thread and automatically interpolate at 120Hz, 144Hz, or 240Hz with zero configuration.