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.
time.cpp
- Committer:
- shennongmin
- Date:
- 2015-02-02
- Revision:
- 10:9d4ec0359a5c
File content as of revision 10:9d4ec0359a5c:
#include "time.h" static unsigned long one_millisecond_counter = 0; static void one_millisecond_callback(void) { one_millisecond_counter++; } unsigned long millis(void) { static Ticker milli_timer; static bool attach_flag = true; if (attach_flag) { attach_flag = false; milli_timer.attach_us(&one_millisecond_callback, 1000); } return one_millisecond_counter; } void delay(int t) { wait_ms(t); }