Interfacing with PWM and servo controls

Hey there everyone,

I'm just getting into Arduino stuff, combining it with my interest in RC helicopters to see what I can do. Eventually, my goal is to build a gyro-stabilized Arduino-controlled quadrocopter for a lifting platform-- that's a ways in the future, though, because the project isn't due until the end of next year :]

Right now, I'm starting by interfacing my Arduino with my RC receiver, trying to read and possibly modify the PWM outputs it sends. I'm wondering what the best (most efficient) way to do this is. Currently, I have:

void setup(){
  int pwmPin = 10;
  pinMode(pwmPin, INPUT);

void loop()
  int starttime;
  int endtime;
  int pulseLength = 0;

  starttime = millis();                                  
  do {
      endtime = (millis() - starttime);
  } while (digitalRead(pwmPin) == HIGH)    //keep incrementing endtime until the pin goes low

That's an older version of the code, and I think I'm using the hpticks function I found on the forums earlier to do the reading now. Questions, though:

*Is this the most efficient way to do the PWM reading? The chip is now just sitting for ~1.5ms every time it wants to read a signal from the RX, is that bad? Am I going to run into trouble when I want to be doing other things very quickly?

*Can I just read the PWM signal as an analog voltage on one of the analog pins?

*Can I write out PWM on a 20ms period-- that is to say, is there a function built in to the Arduino that lets me write HIGH for x ms every 20 ms without having to keep the Arduino doing that loop?

If I'm posting a question that's been asked before, certainly let me know-- otherwise, thanks for all your help :]