Skip to content
Tutorials Center
My learning

Topics

Lesson 7 of 37 ยท Metrics and Core Web Vitals

Interaction to Next Paint (INP)

Understand how INP measures page responsiveness, its three phases (input delay, processing, presentation), and how to break up long tasks and keep the main thread free.

Interaction to Next Paint (INP) measures how quickly a page responds when people click, tap or press a key. For each interaction it records the time from the user's input until the browser paints the next frame showing a response. The page's INP is roughly the slowest interaction of the visit (very high outliers are ignored on pages with many interactions). A good INP is 200 milliseconds or less at p75.

INP replaced First Input Delay as a Core Web Vital because it covers every interaction, not only the first, and includes the time to actually show the result.

What counts as an interaction

  • Mouse clicks
  • Taps on a touchscreen
  • Key presses on a physical or on-screen keyboard

Scrolling and hovering do not count. An interaction can fire several events (pointerdown, pointerup, click); INP measures the whole group.

The three phases

flowchart LR
  A["User input"] --> B["Input delay"]
  B --> C["Processing time"]
  C --> D["Presentation delay"]
  D --> E["Next frame painted"]

INP = input delay + processing time + presentation delay.

Phase What it is Common cause of slowness
Input delay Wait before handlers can start The main thread is busy with another task
Processing time Your event handlers run Heavy work in the handler
Presentation delay Browser calculates layout and paints Large DOM updates, expensive styles

Because there is one main thread, a long task that started before the click makes the click wait. That is why INP is largely about long tasks: any task over 50 ms.

Measuring interactions with the Event Timing API

Observe event timing

Each entry exposes startTime, processingStart, processingEnd and duration, so you can compute the three phases: input delay is processingStart - startTime; processing time is processingEnd - processingStart; the remainder is presentation delay.

Feel a slow interaction

Slow handler versus yielding

In the slow path the "Working..." text never shows, because the browser cannot paint until the handler returns. In the yielding path the feedback paints at once and the heavy work follows. Total work is the same, but the interaction feels fast.

Ways to improve INP

  1. Break up long tasks. Split big loops into chunks and give the browser a chance to paint and handle input between them:

    JavaScript
    async function processAll(items) {
      for (const item of items) {
        handle(item);
        if (navigator.scheduling?.isInputPending?.()) {
          await new Promise(r => setTimeout(r, 0));
        }
      }
    }
    

    Newer browsers also offer scheduler.yield(), which resumes your work at high priority after the browser has had a turn.

  2. Do less in handlers. Show the visible result first; defer analytics, logging and non-urgent updates.

  3. Keep the DOM small. Large DOMs make style and layout slow.

  4. Avoid layout thrashing. Reading layout properties (such as offsetHeight) right after writing styles forces a synchronous layout.

  5. Move heavy computation to a Web Worker so the main thread stays free.

  6. Trim third-party scripts. Tag managers, chat widgets and ads often run long tasks of their own.

Use the Performance panel's Interactions track in Chrome DevTools to see each interaction's three phases and the long tasks that caused them.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which is NOT an INP phase?

    DNS lookup is a network phase of the load; INP covers input delay, processing and presentation.
  2. 2. What is a long task?

    Tasks over 50 ms block input handling and rendering long enough to be felt.
  3. 3. Why does the slow handler never display the Working text?

    Painting happens after JavaScript yields the main thread.
  4. 4. Which counts as an interaction for INP?

    Clicks, taps and key presses count. Scrolling and hovering do not.

Summary

  • INP measures input to next paint across all interactions; good is 200 ms or less at p75.
  • It has three phases: input delay, processing time and presentation delay.
  • Long tasks cause most poor INP, so split them, yield, and do less in handlers.
  • Event Timing and DevTools reveal which interaction and which task are slow.

Next: Cumulative Layout Shift