Quick tip – Checking how much time your javascript runtime needs

 

I don’t often run into things where it surprises me how easy a solution is. Much less so with Javascript. This quick tip may be for you.

Recently I had some performance issues with runtime javascript taking a long time. You can use the following commands to check how long it takes for something to run :

console.time('someFunction');

someFunction(); // or some code

console.timeEnd('someFunction');

The console neatly spits out the amount of miliseconds it took. Nice.


'float:left')); ?>