Function: sleepSync()
sleepSync<
T>(ms:number,value?:T):T
Defined in: sleepSync.ts:12
Sleeps for the specified number of milliseconds synchronously. We should probably note that unlike sleep (which uses CPU tick times), sleepSync uses wall clock times, so the precision is near-absolute by comparison. That, and that synchronous means that nothing else in the thread will run for the length of the timer.
For an asynchronous variant, see sleep.
Type Parameters
| Type Parameter | Default type |
|---|---|
T | undefined |
Parameters
| Parameter | Type | Description |
|---|---|---|
ms | number | The number of milliseconds to sleep. |
value? | T | A value to return. |
Returns
T
See
sleep for an asynchronous version.