1var startTime, endTime;
2
3function start() {
4 startTime = new Date();
5};
6
7function end() {
8 endTime = new Date();
9 var timeDiff = endTime - startTime; //in ms
10 // strip the ms
11 timeDiff /= 1000;
12
13 // get seconds
14 var seconds = Math.round(timeDiff);
15 console.log(seconds + " seconds");
16}