IdleDeadline
인터페이스는 Window.requestIdleCallback()
을 호출하여 설정된 유휴 콜백(idle callback)에 대한 입력 매개변수(parameter)의 데이터 타입으로 사용됩니다. timeRemaining()
메서드를 제공하여 사용자 에이전트가 유휴 상태로있을 것으로 추정하는 시간과 속성(property)인 didTimeout
을 결정할 수있게하여, timeout 기간이 만료되어 콜백이 실행 중인지 여부를 결정할 수 있습니다.
request callback이 작동하는 방식에 대해 자세히알아 보려면, Collaborative Scheduling of Background Tasks 문서를 읽어보세요.
Properties
IdleDeadline.didTimeout
Read only- 유휴 콜백을 구현할 때 지정한 timeout이 만료되었음에도 콜백이 실행중인 경우, 값이 true인 Boolean 입니다.
Methods
IdleDeadline.timeRemaining()
- 현재 유휴 기간(idle period)에 남아있는 밀리초 수를 예측하는 부동 소수점 값인
DOMHighResTimeStamp
를 반환합니다. 유휴 기간이 끝나면 값은 0 입니다. 우리의 콜백은 이것을 반복적으로 호출하여, 반환하기 전에 더 많은 작업을 할 수 있는 충분한 시간이 있는지 확인할 수 있습니다.
Example
Cooperative Scheduling of Background Tasks API의 complete example를 참조하세요.
Specifications
Specification | Status | Comment |
---|---|---|
Cooperative Scheduling of Background Tasks | Proposed Recommendation |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
IdleDeadline | Chrome Full support 47 | Edge No support No | Firefox
Full support
55
| IE No support No | Opera Full support 34 | Safari No support No | WebView Android Full support 47 | Chrome Android Full support 47 | Firefox Android
Full support
55
| Opera Android Full support 34 | Safari iOS No support No | Samsung Internet Android Full support Yes |
didTimeout | Chrome Full support 47 | Edge No support No | Firefox
Full support
55
| IE No support No | Opera Full support 34 | Safari No support No | WebView Android Full support 47 | Chrome Android Full support 47 | Firefox Android
Full support
55
| Opera Android Full support 34 | Safari iOS No support No | Samsung Internet Android Full support Yes |
timeRemaining | Chrome Full support 47 | Edge No support No | Firefox
Full support
55
| IE No support No | Opera Full support 34 | Safari No support No | WebView Android Full support 47 | Chrome Android Full support 47 | Firefox Android
Full support
55
| Opera Android Full support 34 | Safari iOS No support No | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
- User must explicitly enable this feature.
- User must explicitly enable this feature.