Timer Hello World

Fork of Timer_HelloWorld by Mbed

Use

The Timer class is used to measure time. The time will be the amount of time between when the start() and stop() functions are run. The Timer class counts from 0 up.

API

API reference.

Import librarymbed

No documentation found.
Committer:
mbedAustin
Date:
Fri Mar 27 20:18:44 2015 +0000
Revision:
2:9152128dba25
Parent:
0:27e1de20d3cb
Added license to main.c file.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbedAustin 2:9152128dba25 1 /* mbed Example Program
mbedAustin 2:9152128dba25 2 * Copyright (c) 2006-2014 ARM Limited
mbedAustin 2:9152128dba25 3 *
mbedAustin 2:9152128dba25 4 * Licensed under the Apache License, Version 2.0 (the "License");
mbedAustin 2:9152128dba25 5 * you may not use this file except in compliance with the License.
mbedAustin 2:9152128dba25 6 * You may obtain a copy of the License at
mbedAustin 2:9152128dba25 7 *
mbedAustin 2:9152128dba25 8 * http://www.apache.org/licenses/LICENSE-2.0
mbedAustin 2:9152128dba25 9 *
mbedAustin 2:9152128dba25 10 * Unless required by applicable law or agreed to in writing, software
mbedAustin 2:9152128dba25 11 * distributed under the License is distributed on an "AS IS" BASIS,
mbedAustin 2:9152128dba25 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
mbedAustin 2:9152128dba25 13 * See the License for the specific language governing permissions and
mbedAustin 2:9152128dba25 14 * limitations under the License.
mbedAustin 2:9152128dba25 15 */
mbed_official 0:27e1de20d3cb 16 #include "mbed.h"
mbed_official 0:27e1de20d3cb 17
mbed_official 0:27e1de20d3cb 18 Timer t;
mbed_official 0:27e1de20d3cb 19
mbed_official 0:27e1de20d3cb 20 int main() {
mbed_official 0:27e1de20d3cb 21 t.start();
mbed_official 0:27e1de20d3cb 22 printf("Hello World!\n");
mbed_official 0:27e1de20d3cb 23 t.stop();
mbed_official 0:27e1de20d3cb 24 printf("The time taken was %f seconds\n", t.read());
mbed_official 0:27e1de20d3cb 25 }