Hello, I would like to ask the following question: if I write a program, in Arduino IDE, and I want to measure the execution time of some instruction(s), then it will be correct to measure the execution time by using a test variable, for example, let's say:
#define test_var = A2
setup(){
pinMode(test_var, OUTPUT);
digitalWrite(test_var, LOW);
}
loop(){
if ( condition ) {
digitalWrite(test_var, HIGH);
//instructions, etc, etc
digitalWrite(test_var, LOW);
}
}
And for measuring the execution time, I will connect the oscilloscope probe to the pin A2 and GND and I will measure the time test_var is high. It is correct ?
I am sorry if this has been asked before, I searched on the internet and found almost nothing about this, but probably I didn't used the correct search terms...
#define test_var = A2
setup(){
pinMode(test_var, OUTPUT);
digitalWrite(test_var, LOW);
}
loop(){
if ( condition ) {
digitalWrite(test_var, HIGH);
//instructions, etc, etc
digitalWrite(test_var, LOW);
}
}
And for measuring the execution time, I will connect the oscilloscope probe to the pin A2 and GND and I will measure the time test_var is high. It is correct ?
I am sorry if this has been asked before, I searched on the internet and found almost nothing about this, but probably I didn't used the correct search terms...