timeRemaining

The timeRemaining() method on the IdleDeadline interface returns the estimated number of milliseconds remaining in the current idle period.

MDN Reference