Calculating Reaction Time

Actually, I am making a game where random texts are appearing with random colors and the person actually has to select the answer which can be either red, yellow, blue or green colored buttons. If the button color matches with the color of the random text and not the text itself, he gets a SCORE. For each answer he gives, I need the reaction time from the onset of that random colored random text till the person presses the answer button. This has to be done for each and every random text separately and in the end , mean of all reaction times has to be displayed. Any help is this regard would be highly appreciated.
The text random appears 40 times so 40 reaction times need to be calculated and towards the end, the mean of those 40 reaction times need to be calculated. Thanks

welcome...
this seems to be a great task for some homework...
as a start it would help to learn some basics
concerning the reaction time take a look into the Clock component
http://ai2.appinventor.mit.edu/reference/components/sensors.html#Clock