Time

This library waits for and/or measures the specified time.

millis

Description
Returns the number of milliseconds since the GR-KAEDE began running the current program. This number will overflow (go back to zero), after approximately 50 days.
Syntax
unsigned long millis()
Parameters
None
Returns
Number of milliseconds since the program started (unsigned long)

micros

Description
Returns the number of microseconds since the GR-KAEDE began running the current program. This number will overflow (go back to zero), after approximately 70 minutes.
Syntax
unsigned long micros()
Parameters
None
Returns
Number of microseconds since the program started (unsigned long)

delay

Description
Pauses the program for the amount of time (in milliseconds) specified as a parameter.
Syntax
delay(unsigned long ms)
Parameters
ms: The number of milliseconds to pause
Returns
None

delayMicroseconds

Description
Pauses the program for the amount of time (in microseconds) specified as a parameter.
Syntax
delayMicroseconds(unsigned long us)
Parameters
us: The number of microseconds to pause
Returns
None

Sample Program

Displays time since program start in 100ms intervals via serial communications.


#include <Arduino.h>
#define INTERVAL 100
unsigned long val_time;
    
void setup()
{
    Serial.begin(9600);
}
    
void loop()
{
    val_time = millis();
    Serial.println( val_time );
    delay(INTERVAL);
}