--- title: micros() categories: [ "Functions" ] subCategories: [ "Time" ] --- = micros() // OVERVIEW SECTION STARTS [#overview] -- [float] === Description Returns the number of microseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 70 minutes. On the boards from the Arduino Portenta family this function has a resolution of one microsecond on all cores. 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. [%hardbreaks] [float] === Syntax `time = micros()` [float] === Parameters None [float] === Returns Returns the number of microseconds since the Arduino board began running the current program. Data type: `unsigned long`. -- // OVERVIEW SECTION ENDS // HOW TO USE SECTION STARTS [#howtouse] -- [float] === Example Code // Describe what the example code is all about and add relevant code ►►►►► THIS SECTION IS MANDATORY ◄◄◄◄◄ The code returns the number of microseconds since the Arduino board began. [source,arduino] ---- unsigned long time; void setup() { Serial.begin(9600); } void loop() { Serial.print("Time: "); time = micros(); Serial.println(time); //prints time since program started delay(1000); // wait a second so as not to send massive amounts of data } ---- [%hardbreaks] [float] === Notes and Warnings There are 1,000 microseconds in a millisecond and 1,000,000 microseconds in a second. -- // HOW TO USE SECTION ENDS // SEE ALSO SECTION [#see_also] -- [float] === See also -- // SEE ALSO SECTION ENDS