We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2708fe5 commit 526544fCopy full SHA for 526544f
test/helpers/get_time.lua
@@ -34,11 +34,10 @@ else
34
ffi.cdef([[
35
int clock_gettime(int clock_id, void *tp);
36
]])
37
- local ts = ffi.new("struct { long int tv_sec; long int tv_nsec; }")
38
- local enum = 1
+ local ts = ffi.new("struct { long int tv_sec; long int tv_nsec; }[1]")
39
local func = ffi.C.clock_gettime
40
return function()
41
- func(enum, ts)
42
- return tonumber(ts.tv_sec) + tonumber(ts.tv_nsec) * 0.000000001
+ func(1, ts)
+ return tonumber(ts[0].tv_sec) + tonumber(ts[0].tv_nsec) * 0.000000001
43
end
44
0 commit comments