How exactly slow is digitalRead()?

SukkoPera:
Thanks a lot, Peter, that's what I needed to know. One more question though: all those timings are going to double when running at 8 MHz, right?

Naturally.

The complication is of course, that digitalRead() includes the option of using a variable to select the port. That includes the overhead of performing a bit shift according to the variable value (essentially a FOR loop) on the mask bit which is used to select the bit. Then it must perform a zero test in order to determine which value - TRUE or FALSE - to return.

All this is easy but not simple, whereas if you know at compile time, exactly which bit you want and are happy to cope with a zero/ non-zero but probably not specified result, it can be programmed in assembler at lightning (sort of) speed. The digitalRead() function is almost like using an interpreter.