[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [5.1.4] Most portable solution to "sleep"?
- From: "Dimiter \"malkia\" Stanev" <malkia@...>
- Date: Fri, 18 Feb 2011 22:28:06 -0800
This is from Mike Pall's ext_ffi_tutorial.html (latest in git)
It's using LuaJIT's FFI, but one can do it the lua binding way if needed.
local ffi = require("ffi")
void Sleep(int ms);
int poll(struct pollfd *fds, unsigned long nfds, int timeout);
if ffi.os == "Windows" then
ffi.C.poll(nil, 0, s*1000)
for i=1,160 do
On 2/18/11 4:55 AM, Gilles Ganault wrote:
Now that I could create the text file, I need to have the script
pause for a few seconds before resuming.
I checked the archives for this list:
"NEWBIE Question: LUA wait() function?"
Since I cross-compile Lua on Ubuntu and run it on a uClinux appliance,
I need a portable, compact solution to pause a script.
Which solution would you recommend? Compiling Lua with a POSIX
library, such as luaposix? Using "socket.sleep(0.2)"? Other?
I was thinking of using those options in CFLAGS: