const function_arr = [
function (req,resp,next)
{
console.log("1");
next();
},
function (req,resp,next)
{
console.log("2");
next();
},
function (req,resp,next)
{
console.log("3");
},
function (req,resp,next)
{
},
];
async function test ()
{
const data = [];
for (let i = 0; i < 1000; i++)
{
data.push(i);
}
for (let i = 0; i < function_arr.length; i++)
{
await execute_function({name : "req" , data},{name : "resp" , data},function_arr[i]);
}
}
async function execute_function (req,resp,func)
{
return new Promise((res,rej) =>
{
func(req,resp , () =>
{
res();
});
});
}
setInterval(() =>
{
test().then((value) =>
{
console.log(value);
});
} , 500)
console