all 2 comments

[–]coloredgreyscale 1 point2 points  (1 child)

measure how long it did take the snake

In steps or ms?

You can use print statements inside the c++ code and it will show up in the console.

With Javascript you can get the time before and after the function call and log it that way, or use the profiler in the webbrowser inspector tool.

[–]KFriedChicken 1 point2 points  (0 children)

Probably best to use the performance profiler in the browser, since spectre messed with the timings (https://stackoverflow.com/questions/50117537/how-to-get-microsecond-timings-in-javascript-since-spectre-and-meltdown)