Direct port access I/O - write OK but can't read

Cool, it's got all the timings:

But how do the fast port operations compare to the standard speeds on the Uno R4?

I see some 1000X on-off toggling timings in code in this post:

...to give Uno R4 write timings as :

  • digitalWrite(): 1515us/(1000*2)= 757ns
  • fasterDigitalWrite: 1515us/(1000*2)= 590ns
  • digitalWriteFast: 179us/(1000*2)= 90ns
  • POSR/PORR: 179us/(1000*2)= 90ns

I don't have an R4, but I am curious about the Arduino basic digitalRead() speed versus the direct port access Port State Input Read speed of ~165ns.

Could someone try this on an R4?

void setup(){
Serial.begin(115200);
  uint32_t start_time = micros();
  for (int i = 0; i < 1000; i++) {
    digitalRead(13);
  }
  uint32_t delta_time = micros() - start_time;
  Serial.print("digitalRead: ");
  Serial.println(delta_time, DEC);
}

void loop(){}