Returns a promise that will reject after the given duration.
A duration in milliseconds.
Assigns a timeout to the given promise, where if the promise doesn't complete within the given duration an exception will be thrown.
The timeout, in milliseconds.
The promise to assign a timeout to.
Returns a promise that will reject after the given duration.