I am dealing with picoseconds in my code (digits> 10 ^ 12).
C for transferring data to Lua (atime and eventid are of type size_t)
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 as a result in lua I got negative numbers.
source share