store console.timeEnd in variable js

JavaScript
//Not quite using console.time and console.timeEnd, but it will work
//Doesn't log it to console
var start = window.performance.now();
...
var end = window.performance.now();
var time = end - start;
Source

Also in JavaScript: