Skip to main content
added 1 character in body
Source Link
CrossRoads
  • 2.4k
  • 7
  • 9

Comment out these 2 lines

Serial.print("the value is=");
Serial.print("\t");

And report back on the speed difference. Why not add a reading of micros() before and after each loop and see how much difference there really is? All time variables are unsigned long.

startTime = micros();
// your loop
endTime =  micros();
duration = endTime - startTime;
Serial.println (" ";"); // line break
Serial.print ("duration in uS = ";");
Serial.printprintln (duration);

I edited to add some missing )s and a 2nd line break.

Comment out these 2 lines

Serial.print("the value is=");
Serial.print("\t");

And report back on the speed difference. Why not add a reading of micros() before and after each loop and see how much difference there really is? All time variables are unsigned long.

startTime = micros();
// your loop
endTime =  micros();
duration = endTime - startTime;
Serial.println (" "; // line break
Serial.print ("duration in uS = ";
Serial.print (duration);

Comment out these 2 lines

Serial.print("the value is=");
Serial.print("\t");

And report back on the speed difference. Why not add a reading of micros() before and after each loop and see how much difference there really is? All time variables are unsigned long.

startTime = micros();
// your loop
endTime =  micros();
duration = endTime - startTime;
Serial.println (" "); // line break
Serial.print ("duration in uS = ");
Serial.println (duration);

I edited to add some missing )s and a 2nd line break.

Source Link
CrossRoads
  • 2.4k
  • 7
  • 9

Comment out these 2 lines

Serial.print("the value is=");
Serial.print("\t");

And report back on the speed difference. Why not add a reading of micros() before and after each loop and see how much difference there really is? All time variables are unsigned long.

startTime = micros();
// your loop
endTime =  micros();
duration = endTime - startTime;
Serial.println (" "; // line break
Serial.print ("duration in uS = ";
Serial.print (duration);