Hi, I am new to Javascript programming.
I created a simple game where the user needs to click on the boxes. The game ends when the user finishes clicking on 16 boxes.
I want to measure the elapsed time for the user to complete the game. How to do it with Javascript?
Edit: I should have been more clear. I have an algorithm in my head. I did my research. I looked at the different answers. But they were not useful because they showed their own code, which was hard for me to understand.
Start timer: when the user clicks on the first square
Timer: when the user clicks on the last field
Thanks.
source share