[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: os.clock() always return 0 on Archlinux (a Linode instance)
- From: Johnson Lin <arch.jslin@...>
- Date: Wed, 28 Sep 2011 01:10:23 +0800
On Wed, Sep 28, 2011 at 1:00 AM, David Given <dg@cowlark.com> wrote:
>
> Yes. clock() does not return wall-clock time, it returns how much CPU
> time your process is using, so if your process is blocked it won't
> advance. As such it's not useful for anything much.
>
> Go get luasocket and use socket.gettime() instead, it does the right thing.
>
> --
Thanks for the reply! I just found out os.clock() will be stalled by
socket:settimeout() (however it won't on Windows, works fine.)
--Johnson