added jsdoc comments to fakeDelay tool

This commit is contained in:
darkicewolf50 2024-03-12 12:24:54 -06:00
parent 3d0872bd96
commit 09fd161ba2

View File

@ -1,18 +1,12 @@
/**
* @param {int} ms - time in ms to add a delay
* @returns {Promise(resolve)} Promise - reutrns an empty promise after the set time
* @description Testing tool to delay a function deliberatly
* @author Brock <darkicewolf50@gmail.com>
* @example await fakeDelay(5000);
*/
function fakeDelay(ms) { function fakeDelay(ms) {
/* return new Promise((resolve) => setTimeout(resolve, ms));
useful for testing allows for a fake response, allow us to see what the program does while waiting for data from the backend }
REQUIRES:
time in milliseconds
needs a line like this to run
await fakeDelay(5000);
PROMISES:
nothing
Develop in part by: Brock
Contact: darkicewolf50@gmial.com
*/
return new Promise(resolve => setTimeout(resolve, ms));
}
export default fakeDelay; export default fakeDelay;