const byte Squelch = 2; // Receiver Squelch is connected to pin 2
const byte Led = 13; // Uno's built-in LED, used to indicate for debugging
long time=0; // declare time to be long
... // Wait for Rising Edge and return Duration of the Pulse
{ while(!(digitalRead(Squelch))) //Wait for rising Edge
time = millis(); //store time now
digitalWrite(Led,true); //Turn On Led
while(digitalRead(Squelch)) //Wait for falling Edge
Dur=millis()-time; //Compute duration of On time