I have a bit of node.js code as such:
var start = Date.now();
setTimeout(function() {
console.log(Date.now() - start);
for (var i = 0; i < 100000; i++) {
}
}, 1000);
setTimeout(function() {
console.log(Date.now() - start);
}, 2000);
Something strange happens when I run it on my machine. The times I get are something between 970 and 980, and something between 1970 and 1980. Why am I getting times that are earlier than the timeout times?