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:
parent
7131379021
commit
f0553e9da7
@ -250,7 +250,7 @@ static int gettime(struct timespec *spec) {
|
|||||||
static int os_clock(JanetArgs args) {
|
static int os_clock(JanetArgs args) {
|
||||||
JANET_FIXARITY(args, 0);
|
JANET_FIXARITY(args, 0);
|
||||||
struct timespec tv;
|
struct timespec tv;
|
||||||
if (clock_gettime(CLOCK_MONOTONIC, &tv))
|
if (gettime(&tv))
|
||||||
JANET_THROW(args, "could not get time");
|
JANET_THROW(args, "could not get time");
|
||||||
double dtime = tv.tv_sec + (tv.tv_nsec / 1E9);
|
double dtime = tv.tv_sec + (tv.tv_nsec / 1E9);
|
||||||
JANET_RETURN_REAL(args, dtime);
|
JANET_RETURN_REAL(args, dtime);
|
||||||
|
Loading…
Reference in New Issue
Block a user