unsigned long t0 = millis(); delay ( 5000 ); unsigned long t1 = millis(); Serial.println ( t1 - t0 );