1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-29 03:19:54 +00:00

Fix use of gettime

This commit is contained in:
Calvin Rose 2018-09-22 21:50:43 -04:00
parent 7131379021
commit f0553e9da7

View File

@ -250,7 +250,7 @@ static int gettime(struct timespec *spec) {
static int os_clock(JanetArgs args) {
JANET_FIXARITY(args, 0);
struct timespec tv;
if (clock_gettime(CLOCK_MONOTONIC, &tv))
if (gettime(&tv))
JANET_THROW(args, "could not get time");
double dtime = tv.tv_sec + (tv.tv_nsec / 1E9);
JANET_RETURN_REAL(args, dtime);