-
-
Notifications
You must be signed in to change notification settings - Fork 164
Open
Description
mlibc/options/ansi/generic/time.cpp
Lines 37 to 48 in 4cd4b63
// Function taken from musl | |
clock_t clock(void) { | |
struct timespec ts; | |
if(clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts)) | |
return -1; | |
if(ts.tv_sec > LONG_MAX / 1000000 || ts.tv_nsec / 1000 > LONG_MAX - 1000000 * ts.tv_sec) | |
return -1; | |
return ts.tv_sec * 1000000 + ts.tv_nsec / 1000; | |
} |
Metadata
Metadata
Assignees
Labels
No labels