new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Bun · Runtime · all subjects

bun apis/sleep & timing

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Sleep and timing APIs: Bun.sleep, Bun.sleepSync, Bun.nanoseconds

Bun provides Bun.sleep() for async delays, Bun.sleepSync() for synchronous delays, and Bun.nanoseconds() for high-precision timing.

Bun.sleep() async delay by milliseconds

Bun.sleep(ms: number) returns a Promise that resolves after the given number of milliseconds. Alternatively, pass a Date object to receive a Promise that resolves at that point in time.

Bun.sleepSync() blocks thread synchronously

Bun.sleepSync(ms: number) is a blocking synchronous version of Bun.sleep that blocks the current thread for the specified number of milliseconds.

Bun.nanoseconds() returns nanoseconds since process start

Bun.nanoseconds(): number returns the number of nanoseconds since the current bun process started. Useful for high-precision timing and benchmarking.

Example: Bun.sleep with milliseconds

console.log("hello"); await Bun.sleep(1000); console.log("hello one second later!");

Example: Bun.sleep with Date object

const oneSecondInFuture = new Date(Date.now() + 1000); console.log("hello"); await Bun.sleep(oneSecondInFuture); console.log("hello one second later!");

Give your agent this brain