sleepingdog

Async Sleep Utility

Usage no npm install needed!

<script type="module">
  import sleepingdog from 'https://cdn.skypack.dev/sleepingdog';
</script>

README

SleepingDog

There Are Two Kind of Sleep Here

  1. Promise Based
  2. Old Fashion Way

Both Sleep is Non Blocking

// Promise Way

async () => {
    await sleep(2000); // 2000ms
};

Second Way is Old Fashion Settimeout Way

() => {
    oldSleep(3000, () => console.log('Hey'));
};

Available For Both JavaScript & TypeScript