You can use this if you are using jQuery:
$(function(){
$('#timercheck').on('change', function () {
if ($(':checked').length > 0) {
clearInterval(timer);
}
});
var timer = setInterval(function(){
window.location.reload();
},5000);
});
Here #timercheck
is the id of checkbox.