You can use javascript setTimeout for calling a function after 20 min and you can write your code like the following. 20000 means 20 minutes and it will be in millisecond. Or you can use javascript
setInterval for calling a function after 20 min. You can add this setinterval and settimeout function in document.ready function of jquery or yoou can use it anywhere.
setTimeout("MethodToCall()", 20000);
window.setInterval(MethodToCall, 20000);
function MethodToCall()
{
...
//
..
}
And check the idele time like the following
var delay = 30;
var userTimeExpired;
var IDLE_TIMEOUT = 30;
var idleSeconds = 0;
document.onclick = function () {
idleSeconds = 0;
};
document.onmousemove = function () {
idleSeconds = 0;
};
document.onkeypress = function () {
idleSeconds = 0;
};
window.setInterval(CheckIdleTime, 1000);
function CheckIdleTime() {
_idleSecondsCounter++;
var popUpPanel = document.getElementById("scanCardchild");
if (idleSeconds >= IDLE_TIMEOUT) {
}
}