wahern / cqueues

Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua on Unix.
http://25thandclement.com/~william/projects/cqueues.html
MIT License
244 stars 37 forks source link

add cqueues.gettime #249

Closed fperrad closed 3 years ago

fperrad commented 3 years ago

it is an equivalent of socket.gettime

> print(os.time())
1622826677
> print(require'cqueues'.gettime())
1622826677.2564
> 
> print(require'cqueues'.monotime())
19332.194279597

gettime returns an epoch time with ms (milli second) precision.

note: monotime allows to compute duration with us (micro second) precision or better.

daurnimator commented 3 years ago

This seems out of place for cqueues: there isn't anywhere related to cqueues that this function would be recommended.

Consider lunix instead.

fperrad commented 3 years ago

make sense.

lunix seems to be a good alternative to LuaPosix.

on https://github.com/wahern/lunix/tags, there is rel-20190403. but on luarocks.org, you stay with 20170920

see https://github.com/wahern/lunix/issues/15