All Projects â†’ darcyclarke â†’ sleepover

darcyclarke / sleepover

Licence: MIT license
💤 Sleep, snooze & step methods

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sleepover

waiter
Delayed iteration for polling and retries.
Stars: ✭ 17 (+30.77%)
Mutual labels:  delay, sleep
azure-sql-db-sync-api-change-tracking
Using Azure SQL Change Tracking API to Sync mobile Apps data with the Cloud
Stars: ✭ 58 (+346.15%)
Mutual labels:  sync
code-sync
Collaborative cloud platform for students, teachers, and professionals.
Stars: ✭ 28 (+115.38%)
Mutual labels:  sync
syncthing ynh
Syncthing package for YunoHost
Stars: ✭ 27 (+107.69%)
Mutual labels:  sync
locize-cli
locize cli to import / export locales, add / edit / remove sync segments
Stars: ✭ 44 (+238.46%)
Mutual labels:  sync
dotfiles
dotfiles to provision a new macOS with cosy dev setups
Stars: ✭ 88 (+576.92%)
Mutual labels:  sync
coinbase-pro-rs
Coinbase pro client for Rust
Stars: ✭ 127 (+876.92%)
Mutual labels:  sync
Melodrumatic
Audio plugin that lets you use MIDI to pitch-shift via delay to turn unpitched audio into melodies
Stars: ✭ 26 (+100%)
Mutual labels:  delay
py-mongo-sync
Oplog-based data sync tool that synchronizes data from a replica set to another deployment, e.g.: standalone, replica set, and sharded cluster.
Stars: ✭ 102 (+684.62%)
Mutual labels:  sync
docker-wordmove
Docker image to run Wordmove
Stars: ✭ 16 (+23.08%)
Mutual labels:  sync
chainDB
A noSQL database based on blockchain technology
Stars: ✭ 13 (+0%)
Mutual labels:  block
Simulink-Arduino-Serial
How to connect Arduino and Simulink
Stars: ✭ 54 (+315.38%)
Mutual labels:  block
best-queue
Queue in runtime based promise
Stars: ✭ 26 (+100%)
Mutual labels:  await
Discord-Block-Bypass
Simple script that utilities discord's flaw in detecting who blocked who.
Stars: ✭ 24 (+84.62%)
Mutual labels:  block
RPi-MediaLooper
Automatic video or audio loop for digital posters and audiovisual installations using Raspberry Pi hardware
Stars: ✭ 24 (+84.62%)
Mutual labels:  loop
synchly
Automate database backups with customizable recurring schedules.
Stars: ✭ 27 (+107.69%)
Mutual labels:  sync
staticstep
Provides truly zero-cost alternatives to Iterator::step_by for both incrementing and decrementing any type that satisfies RangeBounds<T: Copy + Default + Step>.
Stars: ✭ 13 (+0%)
Mutual labels:  loop
relaks
Asynchrounous React component
Stars: ✭ 49 (+276.92%)
Mutual labels:  await
slack-block-kit
DEPRECATED: Use https://github.com/slack-php/slack-php-block-kit instead
Stars: ✭ 30 (+130.77%)
Mutual labels:  block
Promise.allSettled
ES Proposal spec-compliant shim for Promise.allSettled
Stars: ✭ 93 (+615.38%)
Mutual labels:  await

sleepover Tests

Step, loop & sleep methods

Install

$ npm install sleepover

Usage

const { sleep, over, snooze } = require('sleepover')

sleep(500)
//=> delays execution for 500ms using Atomics.wait

over(30, (i) => console.log(i))
//=> loops 30 times, calling the provided method each time

async function something() {
  await snooze(500)
  //=> delays execution for 500ms using async/await + Promise + setTimeout
}

API

sleep(delay)

delay

Type: number

The number, in ms, that you'd like to delay execution of your code. (utilizes the Atomics API under the hood)

over(times, callback)

times

Type: number

The number of times you would like to loop/iterate.

callback

Type: function

The callback function you want executed on each iteration (it gets provided a single index argument).

snooze(delay)

delay

Type: number

The number, in ms, that you'd like to delay execution of your code. (utilizes a Promise + setTimeout)

atomics

Type: boolean

Result of the test conditions for defining Atomics support in the current environment. Use this to determine whether ot use sleep or snooze respectively.

License

MIT © Darcy Clarke

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].