Accurate timer on the LED display

I'm trying to implement an accurate timer on my Arduino. What this has to do is display the total amount of time (in milliseconds) it took me to get to an specific number using an pushbutton. An example being that when Arduino generates the random number 10 I press the button 10 times and when I reach 10 then the LED display must show the amount of milliseconds it took me to get to 10.

What I tried doing was searching google for timer libraries and tried to implement it but I could not get any wiser from those as the codes being used is really hard and I'm an beginner.

Can someone give me any tips in regard to this?


unsigned long start_time, end_time ;

At the start:

start_time = millis() ;

When complete:

end_time = millis() ;

To display:

Serial.print (end_time - start_time) ; Serial.println ("ms total") ;

BTW "accurate" could mean anything from a few percent to parts-per-billion - you need to
be explicit with the numbers.