mrt-delay
v1.0.5
Published
A package to add a delay (in ms) in between your javascript code..!!
Downloads
7
Readme
mrt-delay
The "mrt-delay" package allows you to add a runtime delay in your code execution. This can be useful when you want to introduce a pause or delay between certain parts of your code. Installation
To install the "mrt-delay" package, run the following command:
npm install mrt-delay
Usage
Require the package in your code:
const mrt_delay = require('mrt-delay').mrt_delay;
Use it inside your async function:
async function foo() {
/*
{
do some stuff
}
*/
let response = await mrt_delay(2000);
/*
{
do some stuff after a delay of 2 seconds
}
*/
console.log(response);
}
foo();
In the above example, the mrt_delay function is called with the desired delay duration in milliseconds. The code execution will pause for the specified duration before proceeding to the next line.