unsigned long timeNow = millis(); // current time milliseconds
unsigned long timeStart = millis(); // time at the beginning of the code
unsigned long timeEnd = millis(); // time at the end of the code event
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println(timeNow);
}
void loop() {
// put your main code here, to run repeatedly: timeStart =
timeStart= millis(); // start the timer
delay(1000); // the event we are measuring
timeEnd = millis(); // end the timer
Serial.println(timeEnd - timeStart);
}