What is Total Blocking Time (TBT)? Main-Thread Stalls & Telemetry
Quantifying main-thread Long Task congestion above the 50ms W3C threshold and slicing JavaScript execution across idle browser frames.
Direct Definition
Total Blocking Time (TBT) is a synthetic lab performance metric that sums the blocking duration - defined as any execution time exceeding 50 milliseconds - of every main-thread Long Task occurring between First Contentful Paint (FCP) and Time to Interactive (TTI).
Mathematical Formulation of Long Task Blocking
Because the browser's UI rendering pipeline and JavaScript runtime share a single cooperative main thread, the Event Loop cannot preempt a currently executing synchronous task to service incoming hardware input. Under the W3C Long Tasks specification, any contiguous task occupying the main thread for more than 50 milliseconds crosses the threshold of human perceptual lag. TBT isolates and sums only the portion of each task that exceeds that 50ms baseline:
| Main-Thread Task Source | Total Task Duration | Non-Blocking Quota | TBT Contribution (Duration - 50ms) |
|---|---|---|---|
| Framework Hydration Task | 135 ms | 50 ms | +85 ms |
| Legacy DOM Recorder Init | 210 ms | 50 ms | +160 ms |
| Yielded Micro-Task Chunk #1 | 42 ms | 50 ms | 0 ms |
| Nexolytix Ring Buffer Flush | 3.4 ms | 50 ms | 0 ms |
In Google Lighthouse v10+, TBT carries a 30% weighting - the single heaviest component of the overall Performance score. High lab TBT during page startup also directly predicts elevated Input Delay within field Interaction to Next Paint (INP) measurements whenever users attempt to click navigation elements while third-party scripts are still bootstrapping.
Why Monolithic Third-Party Bundles Inflate TBT
When a browser downloads a 150 kB script bundle during the FCP-to-TTI window, V8 has to parse the source bytes into an Abstract Syntax Tree (AST), compile bytecode via Ignition, and execute top-level initialization logic in a single synchronous turn. As we saw when benchmarking real-time intent telemetry against legacy session recorders, scripts that walk the entire DOM tree on startup routinely generate single tasks spanning 180ms to 400ms on mid-tier mobile CPUs (like Lighthouse's 4x throttled Moto G4 baseline).
Even if a script tag includes the async attribute, only the network fetch runs off-thread; the subsequent evaluation and bootstrapping execute synchronously on the main UI thread, starving layout recalculations and freezing scroll responsiveness.
Yielding to the Event Loop via Time-Sliced Scheduling
Achieving zero TBT contribution requires decomposing client initialization and buffer processing into discrete micro-chunks that check remaining frame time before continuing. By combining an Asynchronous Command Queue Pattern with cooperative yielding via requestIdleCallback or MessageChannel macro-task scheduling, the runtime guarantees that no contiguous call stack ever approaches the 50ms ceiling:
const MAX_SLICE_MS = 4.0; // Strict sub-frame execution cap
function drainQueueCooperatively(queue, processItem) {
requestIdleCallback((deadline) => {
const sliceStart = performance.now();
snippet
while (
queue.length > 0 &&
deadline.timeRemaining() > 1 &&
(performance.now() - sliceStart) < MAX_SLICE_MS
) {
processItem(queue.shift());
}
// Yield back to browser compositor and input queue if items remain
if (queue.length > 0) {
drainQueueCooperatively(queue, processItem);
}
}, { timeout: 250 });
}
By yielding control back to the browser Event Loop every 4 milliseconds, pending high-priority user inputs and 16.67ms frame paints are interleaved ahead of background telemetry tasks. Because each slice terminates well below 50ms, the resulting TBT overhead registered by Lighthouse and WebPageTest is strictly 0 milliseconds.
Related Glossary Concepts
Eliminate Third-Party Long Tasks
Explore how Nexolytix slices client initialization and behavioral synthesis into sub-4ms idle micro-tasks, preserving 100/100 Lighthouse scores.