Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
javascript
javascript

var count = 300;  // 300 seconds or 5 minutes

setInterval(function() {
  count = count - 1;
  if (count < 0) {
    alert("You have been inactive for more than 5 minutes.  Your session will terminate.");
    // to do - quit program or end session here
  }
}, 1000);  // call this every second (1000 milliseconds)

pui.onuseractivity = function() {
  // reset counter
  counter = 300;
}

...