mirror of
https://github.com/janet-lang/janet
synced 2025-10-21 02:37:49 +00:00
Fix use of gettime
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user