Code time inaccuracy

I've had a look at and measured such things on a scope on a nano AT328 at 16MHz

1/ The digitalWrite() takes about 6uS as against a direct port write of 62.5nS. 100 times slower.
And if you want to change lines simultaneously, no good.

2/the millis() function updates it's count every 1.024mS and takes about 7uS to do it. It doesn't matter whether you use it or not. Hence there is a skip.

3/ The loop() uses about 7uS every time round to perform backgrouind tasks - embed a while(1) if you want to avoid this.

I'm sure there are bits I've missed

Overall a very nice and easy environment to use, but has significant overheads.

Allan