[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] lua-time
- From: Sam Roberts <vieuxtech@...>
- Date: Tue, 11 Oct 2011 12:57:15 -0700
On Tue, Oct 11, 2011 at 12:42 PM, Louis Mamakos <louie@transsys.com> wrote:
> How about an API that looked like this:
> seconds, fractional_seconds = foo.time()
> You'd return integer seconds as the first return value, and fractional
> seconds (as a floating point number) as the second result. Code that was
I prefer to just return the time as a single number, with decimal
precision. lusocket has
http://sam-github.github.com/luasocket/socket.html#gettime
It has (theoretically) nanosecond resolution on windows, and
millisecond on unix.
And, of course, I wrote my own before noticing that it existed:
https://github.com/sam-github/libnet/blob/master/lua/net.c, lnet_gettimeofday()
I bet luaposix has one, too.
Cheers,
Sam