Arduino Programming Language: Micros

Name

micros()

Description

This function returns the number of microseconds since the current program started. 
It resets every about 70 minutes. 
The resolution of microseconds is different for each Arduino board in use.

Syntax

micros();

Parameters

  • none

Returns

unsigned long 

Usage

Application

Examples

unsigned long time;

void setup(){
Serial.begin(9600);
}
void loop(){
time = micros();
//prints time since program started
Serial.println(time);
delay(100);
}

Related Functions


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc