Run while off
it isn't running, it just calculates how much time it has been since you last were on the site (using local storage) and then uses that to see how many cacti you would have got in that time : )
@WilliamXing What he's saying, is to put the current time in local storage.
Then when you reopen the page, take that time and the current time now. Remove the old time from the new time to tell how much time has passed. Once you know how many seconds have passed, you can easily multiply that by the amount of cacti/points you get per second, then add that to your score.
Whatever the time is
var myTime = new Date.getTime();
Saving that to local storage
Then getting that value
oldTime = +localStorage.getItem('time')
2 - 1 // will give us 1
With the time
currentTime = new Date.getTime(); timePassed = currentTime - oldTime;