//Renvoie le temps suite à l'appuie sur le BP
//DNC e Solution
//le 08/02/2022
const int switchPin = 2;
long starTime;
long duration;
void setup()
{
pinMode(switchPin, INPUT);
digitalWrite(switchPin, HIGH);
Serial.begin(9600);
}
void loop()
{
if(digitalRead(switchPin)==LOW)
{
starTime=millis();
while (digitalRead(switchPin)==LOW);
duration=millis()-starTime;
Serial.println(duration);
}
}