1.0.9 • Published 2 years ago

s1eep v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
2 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

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago