lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Wouldn't that be busy ?

On Wed, Oct 13, 2010 at 1:26 PM, Gabriel Duarte <> wrote:
Try out

function sleep(length)
    local start = os.clock()
    while os.clock() - start < length do end

On Wed, Oct 13, 2010 at 2:20 PM, Henning Diedrich <> wrote:
Hi list,

is there a sleep function that is
- non-busy
- allows for ctrl-C
- doesn't get stuck
- does not require a C extension

I tried busy, system call and sockets from for the above reasons they don't work for me.

Is there a rock offering a simple C-programmed sleep?

It's for a very simple game world tick with the focus on demonstrating (other) principles, and ease of getting to run oneself.


Gabriel Duarte
Linux User #471185
Rio de Janeiro - RJ

(55) (21) 9463-7760  -> Mobile
(55) (21) 2464-9302  -> Home
(55) (21) 2529-5080  -> Work