The code:
Result:
Is it possible reduce the processing time below 1us?
If not possible, it's because:
- Because it's running on Arduino IDE?
or
- Because it's the total process time from: read number of microseconds - write to t1 array- read j from memory - increment j - writing j to memory - read number of microseconds - write to t2 array?
or ....?
Code:
unsigned long t1[10], t2[10];
int i,j;
void setup() {
Serial.begin(9600);
}
void loop() {
for(i=0;i<10;i++) {
t1[i] = micros();
j++;
t2[i] = micros();
}
Serial.println("\nrun");
for(i=0;i<10;i++) {
Serial.print(t2[i] - t1[i]);
Serial.print(" us\n");
}
delay(10000);
j=0;
}
Is it possible reduce the processing time below 1us?
If not possible, it's because:
- Because it's running on Arduino IDE?
or
- Because it's the total process time from: read number of microseconds - write to t1 array- read j from memory - increment j - writing j to memory - read number of microseconds - write to t2 array?
or ....?