Fix wording and code example in docs for Bun.sleepSync (#3270)

This commit is contained in:
paperluigis
2023-06-10 13:03:30 +05:00
committed by GitHub
parent f18423cf45
commit f51878a8ec

View File

@@ -75,16 +75,6 @@ Bun.sleepSync(1000); // blocks thread for one second
console.log("hello one second later!");
```
Alternatively, pass a `Date` object to receive a `Promise` that resolves at that point in time.
```ts
const oneSecondInFuture = new Date(Date.now() + 1000);
console.log("hello");
await Bun.sleep(oneSecondInFuture);
console.log("hello one second later!");
```
## `Bun.which()`
`Bun.which(bin: string)`