Oups, you're entirely right :
I did benchmark with only
for (int i=0; i < N; i++){
PORTD = B1000;
PORTD = B11110111;
}
Many thanks, you helped found me a bug
So about my code, in particular last PORT call (extract_off), how many cycles the while(true) will use ?
Please note that I TDMA frame my pulses so i'm not using while() to toggle but rather tune parameters with cycle offset corrections to get proper timing.
Worthwhile noting if 2 pins belong same port, we can set or clear within same cycle two outputs.
Again many thanks for all your support on this thread & the other one about scaning USB activity in 2 cycles.