Arduino - micros () function

The micros() function returns the number of microseconds from the time, the Arduino board begins running the current program. This number overflows i.e. goes back to zero after approximately 70 minutes. On 16 MHz Arduino boards (e.g. Duemilanove and Nano), this function has a resolution of four microseconds (i.e. the value returned is always a multiple of four). On 8 MHz Arduino boards (e.g. the LilyPad), this function has a resolution of eight microseconds.

micros() function Syntax

micros () ;

This function returns number of microseconds since the program started (unsigned long)


unsigned long time; void setup() { 

void loop() { 
   time = micros(); //prints time since program started
   Serial.println(time); // wait a second so as not to send massive amounts of data
Kickstart Your Career

Get certified by completing the course

Get Started