void setup()
{
  pinMode(13,OUTPUT);
  digitalWrite(13,LOW);  /* turn off LED */
  
  pinMode(9,INPUT);
  digitalWrite(9,HIGH); /* is HIGH is no connection*/
}

unsigned long startTid, stopTid, reaktionsTid;

void loop()
{
  digitalWrite(13,LOW); /* LED off */
  delay(5000);   /* wait 5 seconds */
  startTid = millis(); /* start time in milli seconds*/
  digitalWrite(13,HIGH);
  
  while (HIGH == digitalRead(9) ) {}
  stopTid = millis();
  
  reaktionsTid = stopTid - startTid;
  Serial.print("Reaktionstid (ms) ");
  Serial.println(reaktionsTid);
}
