Recently, I have created a function that automatically calls every 15 seconds.
setInterval(
function () {
check_alive_status();
},
15000 // every 15 seconds
);
However, I now have a new requirement where I only want this function to run for the first 5 minutes and then stop. Is there a way to achieve this?
In addition to this, I also need to check if there are any background processes such as ajax calls or file uploads happening on the webpage. If there are no active processes and the page is idle, I want to log out the user after 15 minutes. How can I implement this too? Thank you!