Skip to content Skip to sidebar Skip to footer

How To Know Which Part Of My JS Is Making It Laggy?

I'm a javascript beginner and I'm trying to improve my skills. I'm currently working on canvas and animation through website. What I'm trying to do is a 'simulation' of a city car

Solution 1:

You can see where the code is spending its time using the Developer Tools in any major modern browser. Select the devtools from the menu, or press Ctrl+Shift+I or F12 (or Cmd+Shift+I on Mac OS). There's likely a Performance or Profiling tab (for instance, in Chrome, it's Performance). You can use the features there to run your code, and see what functions it's spending the most time in, etc. Your browser's devtools will likely be reasonably well-documented. There's an article on using Chrome's Performance tab here.


Post a Comment for "How To Know Which Part Of My JS Is Making It Laggy?"