import { rnxExit } from '../../run-rnx' import { sleep } from './shared' export async function runSleepSubcommand(opts: { positional: string[] inspectUsage: (name: string, tail: string) => string }): Promise { const seconds = opts.positional[1] ? Number(opts.positional[1]) : 0.5 if (!Number.isFinite(seconds) || seconds < 0) { console.error(opts.inspectUsage('sleep', '[seconds]')) rnxExit(1) } await sleep(seconds * 1000) console.log(` slept ${seconds}s`) }