I have an if..else condition in my javascript and I want to include a timer function in the else loop to know how long it took for that part to be executed. How can I achieve this?
I'm not sure I follow, you mention else loop? You could store the time stamp in a variable, do some actions then store a second time stamp calculate the difference. Why are you timing the code though?