8000 Introduce @lute/time runtime library by ffrostfall · Pull Request #220 · luau-lang/lute · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Introduce @lute/time runtime library #220

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

Merged
merged 9 commits into from
May 1, 2025

Conversation

ffrostfall
Copy link
Contributor

Closes issue #75 by introducing a time library.

Includes a time.now() function, which uses libuv's cross-platform clock_gettime function for instants with nanosecond precision. Since libuv's return result is sec + nsec, we cast both into doubles and then divide down.

time isn't available as a namespace name due to conflicts in other include statements, so the namespace is libtime.

8000 Copy link
Collaborator
@aatxe aatxe left a comment

Choose a reason for hiding this comment

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

Overall, looks pretty good, just needs a little more cleanup.

@aatxe aatxe merged commit bcaeab7 into luau-lang:primary May 1, 2025
6 checks passed
green-real pushed a commit to green-real/lute that referenced this pull request May 19, 2025
Closes issue luau-lang#75 by introducing a time library.

Includes a `time.now()` function, which uses libuv's cross-platform
`clock_gettime` function for instants with nanosecond precision. Since
libuv's return result is `sec` + `nsec`, we cast both into doubles and
then divide down.

`time` isn't available as a namespace name due to conflicts in other
include statements, so the namespace is `libtime`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0