Timing of various functions on ATMEGA 328P chip (Arduino Uno, Arduino Nano, etc) [stub]

Robin2:
I'd prefer to see the OP's program and his/her own description of the timing process.

...R

The code is super basic; just activate the respective pins and run the short program. I used the digitalWrite High followed by digitalWrite Low in order to create a visible time-stamp on the Oscilloscope, the length of that time-stamp also represents the amount of time it takes for a digitalWrite High... digitalWrite Low command to execute.

Then I just put different functions in after that part of the code and used the scope to identify how much time between the peaks passed by, if it went from 4uS to 8uS then we can identify that it took 4uS for whatever was added to execute.

It is super basic but here it is...

"
void setup()
{
Serial.begin(9600);
pinMode(7, OUTPUT);
}

void loop()
{
digitalWrite(7, HIGH);
digitalWrite(7, LOW);
//WHATEVER FUNCTION WE ARE MEASURING TIMING OF
}
"

And, yes regardless of whether Serial.begin(value) is set to 9600 or 115200 or even 250000; the results of the timing of Serial.print(""); are the same...

I will try the digitalWriteFast commands and see what difference it makes.

Also; what do you mean by "fighting the optimiser" give me a math function to test and I'll be happy to see the effect...