1//start timer
2console.time();
3//your code
4//example:
5let a = 1000 / 90;
6let b = a%(100/90*198) ^ 89 >> 1 << 2;
7//stop timer
8var timeTakenForCodeToRun = console.timeEnd();
1// use new Date to specify the dates
2var myDate = new Date(/*YOUR DATE VALUES, STRING or NUMBER PARAMETERS*/);
3
4// example
5var date1 = new Date("2010-9-16 13:30:58"); // Thu Sep 16 2010 13:30:58
6var date2 = new Date(2015, 7, 18, 14, 20, 48); // Tue Aug 18 2015 14:20:48
7
8// checking with date is more recent to get the other out of it and store the result in dateDifference variable
9var dateDifference;
10if (date2 < date1) {
11 dateDifference = date2 - date1;
12}
13else{
14 dateDifference = date1 - date2;
15}
16
17console.log(dateDifference); // the result will be in milliseconds