The two things a policy needs from time.
Every policy reads the clock through this interface and none of them call Date.now or setTimeout directly, so a test can run a five-minute backoff schedule without waiting five minutes.
Date.now
setTimeout
Current time in milliseconds. Only differences between readings are used.
Resolves after ms, or rejects with the signal's reason if it aborts first.
ms
Optional
The two things a policy needs from time.
Every policy reads the clock through this interface and none of them call
Date.noworsetTimeoutdirectly, so a test can run a five-minute backoff schedule without waiting five minutes.