im trying to get the current time timeNow in javascript and at the end of the script get
timeEnd which is when the script finished executing for example:
newDate = new Date();
timeNow = newDate.getTime();
for(i=0; i < 5; i ++){
console.log("printing" + i);
}
timeEnd = timeNow - newDate.getTime();
console.log(timeEnd);
i want to get the time it took to excute this script in seconds or milliseconds, but the result is 0. i don't see why, can you help me thanks.