lua-users home
lua-l archive

Re: os.clock() always return 0 on Archlinux (a Linode instance)

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


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

AltStyle によって変換されたページ (->オリジナル) /