1.0.0 • Published 2 years ago

puresleepjs v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

PureSleepJS

Sleep for javascript/nodejs in pure javascript with while loops and exec.

Get it at npm, these example are the only api that exist.

Example:

const PureSleepJS = require("puresleepjs");

var second = 1;

var millisecond = 500;

PureSleepJS.pingSleep(second);

PureSleepJS.nativeSleep(second);

PureSleepJS.pythonSleep(second);

PureSleepJS.whileSleep(millisecond); // Do not do this unless you want 100% on your CPU or you need millisecond support, but cannot use async or promises

(async function(){

    await PureSleepJS.promiseSleep(millisecond); // use this if possible, but if you cannot use async or promises and you need millisecond, use the while sleep

})();