Time

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

millis

Description Returns the number of milliseconds since the GR-SAKURA 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-SAKURA 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

Descriptions Pauses the program for the amount of time (in miliseconds) specified as 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 parameter.
Syntax delayMicroseconds(unsigned long us)
Parameter 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);
}

Made by Gadget Renesas Project
Contents are CC BY-SA 3.0