You are viewing an older revision! See the latest version

Timer

Table of Contents

  1. Hello World!
  2. API

The Timer interface is used to create, start, stop and read a timer for measuring small times (usually fractions of a second).

Any number of Timer objects can be created, and can be started and stopped independently

Hello World!

Simple timer example

#include "mbed.h"

Timer t;

int main() {
    t.start();
    printf("Hello World!\n");
    t.stop();
    printf("The time taken was %f seconds\n", t.read());
}

API

API summary

[error loading api]

All wikipages