← Back to release summary

Remove clamping of setTimeout(..., 0)

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome Enabled by default)
Intent stage
Shipped

Summary

Calls to setTimeout(..., 0) were previously clamped to a 1 ms timeout, instead of resulting in a callback as soon as possible. This clamping is being removed. To get the old behavior, use setTimeout(..., 1) instead.

Motivation

This is intent to remove 1ms clamping from JavaScript setTimeout() with a timeout of 0ms, which is not specified in HTML spec and Safari doesn't enforce this clamping. Removing this clamping results in performance improvement on Speedometer.

Standards & signals

View on chromestatus.com