This works:
document.getElementById("2").innerHTML = new Date().getTime() - startDelay ;
var startDelay; //global scope
startDelay = new Date().getTime(); //this is done inside of a function
this also works
document.getElementById("2").innerHTML = startDelay + " " + startTime ;
var startTime; //global scope
startTime = new Date().getTime(); //this is done in another function
//For some odd reason this does NOT work :/
document.getElementById("2").innerHTML = new Date().getTime() - startDelay + " " + new Date().getTime() - startTime;
Running this in chrome: This gives me a single NAN
document.getElementById("2").innerHTML = 1 + " " + new Date().getTime() - startTime;
This also gives me a NAN error!