[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Sleep miliseconds
- From: Peter Harris <lua@...>
- Date: Mon, 15 Aug 2011 19:32:03 -0400
On Mon, Aug 15, 2011 at 4:57 PM, Luiz Henrique de Figueiredo wrote:
>> Perhaps a nicer solution would be to extend luaposix sleep to accept
>> fractional values and call first posix sleep() for the integer part, then
>> posix usleep() for the fractional part. However, you have to take care of
>> how the new sleep function responds to signals.
>
> Why not simply call usleep with t*1e6 ?
Because POSIX allows usleep to return EINVAL if the argument is >=
1e6, and some OSs are silly enough to actually enforce this limit (eg.
HP-UX).
Peter Harris