Go Down

Topic: How to use millis() or micro() function in Arduino Due (Read 553 times) previous topic - next topic


I want to measure the execution time of my code using micros() function. I have previously used it in Arduino 2560. But when I am using it in Due, it is showing error. I assigned the time variable as -
Unsigned long time

and it is showing as
'long unsigned int time' redeclared as different kind of symbol

Please help me out.


If saving to a variable, you should do like this:

Code: [Select]
long actualTime = micros(); // Or, millis();
Arduino DueTimer | https://github.com/ivanseidel/DueTimer
Arduino Thread | https://github.com/ivanseidel/ArduinoThread

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131