1
0
mirror of https://github.com/janet-lang/janet synced 2025-08-28 00:22:26 +00:00

Merge pull request #1626 from nlordell/fix/clocks-per-sec

Use `CLOCKS_PER_SEC` instead of `CLOCKS_PER_SECOND`
This commit is contained in:
Calvin Rose 2025-08-18 07:35:20 -05:00 committed by GitHub
commit 99abada2c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -950,8 +950,8 @@ int janet_gettime(struct timespec *spec, enum JanetTimeSource source) {
}
if (source == JANET_TIME_CPUTIME) {
clock_t tmp = clock();
spec->tv_sec = tmp / CLOCKS_PER_SECOND;
spec->tv_nsec = ((tmp - (spec->tv_sec * CLOCKS_PER_SECOND)) * 1000000000) / CLOCKS_PER_SECOND;
spec->tv_sec = tmp / CLOCKS_PER_SEC;
spec->tv_nsec = ((tmp - (spec->tv_sec * CLOCKS_PER_SEC)) * 1000000000) / CLOCKS_PER_SEC;
}
return 0;
}