{"version":3,"sources":["../../../src/lib/sleepSync.ts"],"names":[],"mappings":";;;;;;AAWO,SAAS,SAAA,CAAyB,IAAY,KAAc,EAAA;AAGlE,EAAO,OAAA,KAAA;AACR;AAJgB,MAAA,CAAA,SAAA,EAAA,WAAA,CAAA","file":"sleepSync.cjs","sourcesContent":["/**\n * Sleeps for the specified number of milliseconds synchronously.\n * We should probably note that unlike {@link sleep} (which uses CPU tick times),\n * sleepSync uses wall clock times, so the precision is near-absolute by comparison.\n * That, and that synchronous means that nothing else in the thread will run for the length of the timer.\n *\n * For an asynchronous variant, see [sleep](./sleep.d.ts).\n * @param ms The number of milliseconds to sleep.\n * @param value A value to return.\n * @see {@link sleep} for an asynchronous version.\n */\nexport function sleepSync<T = undefined>(ms: number, value?: T): T {\n\tconst end = Date.now() + ms;\n\twhile (Date.now() < end) continue;\n\treturn value!;\n}\n"]}