hi all, I'm trying to evaluate the time necessary to run a function but seem to have an issue with units. Here's the code :
unsigned long timeNecessary1 = 0; unsigned long timeNecessary2 = 0; timeNecessary1 = micros(); IRscan(); // this is my function timeNecessary2 = micros(); Serial.begin(9600); Serial.println(""); Serial.println(timeNecessary1,DEC); Serial.println(timeNecessary2,DEC);
Then i substract one from the other. The problem is the numbers don't make any sense. The results are :
- timeNecessary2 is 2483394992
- timeNecessary1 is 23462246
When i substract one from the other i get 2.12*10^3 seconds wich does not make sense. Do you guys see any issues with the code?