var ts1 = performance.now(); // Function to time goes here: var ts2 = performance.now(); console.log("Function took " + (ts1 - ts2) + " milliseconds to execute.")