mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
...
This commit is contained in:
parent
1ea83cf10b
commit
4cea396016
@ -6,11 +6,11 @@
|
|||||||
|
|
||||||
int64_t time_ns() {
|
int64_t time_ns() {
|
||||||
struct timespec tms;
|
struct timespec tms;
|
||||||
#if defined(__ANDROID__) || defined(__MINGW32__) || defined(__MINGW64__) || !defined(TIME_UTC)
|
#ifdef _MSC_VER
|
||||||
clock_gettime(CLOCK_REALTIME, &tms);
|
|
||||||
#else
|
|
||||||
/* The C11 way */
|
/* The C11 way */
|
||||||
timespec_get(&tms, TIME_UTC);
|
timespec_get(&tms, TIME_UTC);
|
||||||
|
#else
|
||||||
|
clock_gettime(CLOCK_REALTIME, &tms);
|
||||||
#endif
|
#endif
|
||||||
/* seconds, multiplied with 1 billion */
|
/* seconds, multiplied with 1 billion */
|
||||||
int64_t nanos = tms.tv_sec * NANOS_PER_SEC;
|
int64_t nanos = tms.tv_sec * NANOS_PER_SEC;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user