Today I Learned

hashrocket A Hashrocket project

Log timings with javascript console

If you're curious about the time delta between two lines of code in javascript, you can use the console.time and console.timeEnd functions to get that delta.

> console.time("a")
undefined
> console.timeEnd("a")
a: 8136ms
undefined

The string passed in is just a token for the section you want to time.

h/t Chase McCarthy

See More #javascript TILs
Looking for help? At Hashrocket, our JavaScript experts launch scalable, performant apps on the Web, Android and iOS. Contact us and find out how we can help you.