1.0.9 • Published 3 years ago

s1eep v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

delay method

  • You can put a delay in a while loop

Usage

1- Async Sleep

var {asyncsleep, sleep} = require('s1eep');
  • asyncsleep(n): sleep for n miliseconds
  • sleep(n): sleep for n miliseconds

Example

    var {asyncsleep, sleep} = require('s1eep');
  • example-1 {with async method}

      async function start(){
          while(true){
              console.log('hello world)
              await asyncsleep(1000)
          }
      }

  • example-2 {with regular method}

      while(true){
          console.log('hello')
          sleep(1000)
       }

example.gif)

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago