How fast is your code?

You ever wanted to know how long does a block of your code takes to execute? Well you have come to the right place.
You can simply wrap your block of code with console.time function to measure how long your code took to execute.

console.time("Label A")
let num = -999999
for(let i = 0; i < 99999; i++){
num++
}
console.log(num)
console.timeEnd("Label A")

--

--

Programming & Networking Enthusiast {Student} http://niraj-stha.com.np/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store