I'm not sure what you used to measure at 10ns precision
So you are looking at accuracy and precision for the clock. The difference between 1000ms and 1000.01ms is 0,001%.. Clearly beyond the low grade ceramic oscilator that's builtin
You could try with micro and a faster baud rate see if you get better results
unsigned long lastTime = 0;
const unsigned long myInterval = 1000000ul;
void setup() {
Serial.begin (115200); // don't go slow. interrupts do have impact. even go for 1000000 or 2000000
}
void loop() {
uint32_t now = micros();
if ( now - lastTime >= myInterval) {
lastTime += myInterval;
Serial.println (analogRead (A0));
}
}
same result here...
i want to use the motor stepper to follow earth rotation, arround 4,300,800 step for 1 full rotation for 86,124 minutes + 0.916 seconds
it takes about 0.1 ms to read an analog input and OP is doing it twice, so I wonder what's the purpose of being that precise in the first place anyway...