AnalogRead, or timer1 interrupt?

I have a program in which I read an analog pin every 50 ms., using analogRead(). The same program has a timer configured to issue a data output every 50 ms. I understand that analogRead() requires about 100 ms. to execute. Does the timer interrupt have priority over analogRead(), or vice-versa?

Thanks in advance for any revelations.

jrdoner: I have a program in which I read an analog pin every 50 ms., using analogRead().

...

I understand that analogRead() requires about 100 ms. to execute.

How can you possibly do something every 50ms if it takes 100ms to complete?

The timer interrupt will interrupt the analogRead.

If you really are trying to send data from an ISR, I suspect you're about to have even bigger problems very soon. Sending comms from an ISR is a bad idea.

Post your code.

I understand that analogRead() requires about 100 ms. to execute.

I think you meant 100uS, 0.1mS. So a reading every 50mS is possible.

No, I am using the timer to set a flag informing the loop to send out the data. Interrupts are best used for very minimal actions.

You have an Arduino in your hands and you can't write a simple program to make 10,000 analog reads and print the time taken? It should only take a second.

104 ┬ÁS as CrossRoads said.

http://www.gammon.com.au/adc

Does the timer interrupt have priority over analogRead(), or vice-versa?

The timer will interrupt the analogRead.