Speed of while loop

Out of curiousity, how many empty while loops will an arduino (Duemilanove) process per second?

How dependent is it on the condition statement, and is the condition statement optimised at compile time or does efficient coding make a difference?

How dependent is it on the condition statement,

I'd say it's the dominant factor. If the condition is a compile-time constant, then it will be optimised.

Right.

The reason I asked is that I'm using empty while loops to wait for a condition to be met, and I wondered how fast it'd go. I suppose it'll be slowed the most by reading an analogue pin? It's not at all consequential to what I'm doing.

I'm making a fan POV. I'm using a light dependent resistor on the fan and a hand held laser pointer to mark time. I wait for the laser to hit in a while loop.

I wait for the laser to hit in a while loop

Why are you using an analogRead to detect the laser? As you've observed, they're quite slow (100us ish slow).

What's wrong with digital?

[edit]Re-read it - an LDR is not ideal either - the response is really slow and pretty sloped. A photodiode will give you a much cleaner edge.[/edit]

It's what I've got to hand.

I'll use a magnet and hall effect switch when I've got a big enough order to get one (I'm paying handing and shipping on one cheap component).

edit: also, if the lag is constant it won't matter. I need to know the time for one rotation of the fan.