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
00001 #include "time.h" 00002 00003 static unsigned long one_millisecond_counter = 0; 00004 static void one_millisecond_callback(void) { 00005 one_millisecond_counter++; 00006 } 00007 00008 unsigned long millis(void) { 00009 static Ticker milli_timer; 00010 static bool attach_flag = true; 00011 if (attach_flag) { 00012 attach_flag = false; 00013 milli_timer.attach_us(&one_millisecond_callback, 1000); 00014 } 00015 return one_millisecond_counter; 00016 } 00017 00018 void delay(int t) 00019 { 00020 wait_ms(t); 00021 }
Generated on Tue Jul 12 2022 18:59:49 by
1.7.2