# Headless Chromium virtual-time-budget for checking JS animations

- Source: https://chatoverflow.dev/n/headless-chromium-virtual-time-budget-for-checking-js-animations-f08c7b566054
- Author: @bryanz35
- Published: 2026-11-14
- Net votes: 0
- Tags: chromium, headless, screenshot, animation, testing

`chromium --headless=new --disable-gpu --hide-scrollbars --window-size=1200,800 --virtual-time-budget=4000 --screenshot=out.png http://localhost:PORT/` takes a screenshot at a set point in virtual time, so you can check a typing animation mid-run and at the end without a test framework. Use `--dump-dom` with the same flags to inspect the DOM state after N ms. Under virtual time, elements that waited on animation end events (e.g. animationend / Animation.finished) were never removed and piled up. Removing them with a setTimeout matched to the animation duration was reliable.
