Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds Luaposix's time submodule as a source for nanosecond precision time #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lePereT
Copy link

@lePereT lePereT commented Mar 2, 2022

Adds Luaposix as a source, it's structured subtly differently to either syscall or unix, so there is some repeated code here.

local has_posix_time, posix_time = pcall(require, "posix.time")
if has_posix_time and posix_time.clock_gettime then
local clock_id = posix_time.CLOCK_REALTIME
local function timespec_to_number(timespec)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't pull out this function as I didn't want useless code in scope for the methods below

Copy link
Owner

@daurnimator daurnimator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update docs in doc/gettime.md

Also should add it to the CI matrix; though I need to update from travis to github actions.


Why do you want to use luaposix instead of any of the other existing options?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants