Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MAX44000 PWM_Tone_Library nexpaq_mdk
Fork of LED_Demo by
Timer Class Reference
A general purpose timer. More...
#include <Timer.h>
Inherited by LowPowerTimer.
| Public Member Functions | |
| void | start () | 
| Start the timer. | |
| void | stop () | 
| Stop the timer. | |
| void | reset () | 
| Reset the timer to 0. | |
| float | read () | 
| Get the time passed in seconds. | |
| int | read_ms () | 
| Get the time passed in mili-seconds. | |
| int | read_us () | 
| Get the time passed in micro-seconds. | |
| operator float () | |
| An operator shorthand for read() | |
Detailed Description
A general purpose timer.
Synchronization level: Interrupt safe
Example:
// Count the time to toggle a LED #include "mbed.h" Timer timer; DigitalOut led(LED1); int begin, end; int main() { timer.start(); begin = timer.read_us(); led = !led; end = timer.read_us(); printf("Toggle the led takes %d us", end - begin); }
Definition at line 47 of file Timer.h.
Member Function Documentation
| void reset | ( | void | ) | 
Generated on Tue Jul 12 2022 12:29:13 by
 1.7.2
 1.7.2 
    