Write a JavaScript program to measure the time taken by a function to execute. code example
Example: time taken for a function javascript
console.time("timer"); //start time with name = timer
console.timeEnd("timer"); //end timer and log time difference