We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98182a9 commit 905a18aCopy full SHA for 905a18a
ports/unix/unix_mphal.c
@@ -216,6 +216,7 @@ mp_uint_t mp_hal_ticks_us(void) {
216
}
217
218
uint64_t mp_hal_time_ns(void) {
219
- time_t now = time(NULL);
220
- return (uint64_t)now * 1000000000ULL;
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
221
+ return (uint64_t)tv.tv_sec * 1000000000ULL + (uint64_t)tv.tv_usec * 1000ULL;
222
ports/windows/windows_mphal.c
@@ -255,3 +255,9 @@ mp_uint_t mp_hal_ticks_cpu(void) {
255
return value.LowPart;
256
#endif
257
258
+
259
+uint64_t mp_hal_time_ns(void) {
260
261
262
263
+}
0 commit comments