I deal with picoseconds in my code (numbers are > 10^12).
C code to pass data to Lua (atime and eventid are both of size_t type)
lua_getglobal ( luactx, "timer_callback" );
lua_pushunsigned ( luactx, atime );
lua_pushunsigned ( luactx, eventid );
lua_pcall ( luactx, 2, 0, 0 );
Lua function
function timer_callback(time, eventid)
if eventid == TX_CLOCK then
out_log(tostring(time)) --result is random garbage
set_callback(time + 1000000000000, TX_CLOCK)
return
end
end
I tried with lua_pushnumber but in result in lua I got negative numbers.