use a quick timeout for headless, not requestanimationframe
optimize progress bar updating