var time = new Date();
function Startfnc() {
console.log('Startfnc exec now');
time = new Date();
};
var timerId = setInterval(function () {
Startfnc();
}, 10000);
var logging = setInterval(function () {
var localdate = new Date();
console.log('last coll: ' + (localdate - time));
}, 2000);
>node test
last coll: 2002
last coll: 4119
last coll: 6129
last coll: 8131
Startfnc exec now
last coll: 130
last coll: 2131
last coll: 4133
last coll: 6134
last coll: 8134
Startfnc exec now
last coll: 132
last coll: 2132
last coll: 4133
last coll: 6135
last coll: 8136
Startfnc exec now