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

Use Chronos extension if available #7

Merged
merged 1 commit into from Feb 28, 2024
Merged

Conversation

redoak
Copy link
Contributor

@redoak redoak commented Feb 27, 2024

⚠️ Only tested on Windows

I'm not sure why you floor the time diff.

local diff_time = math.floor((current_time - self._last_message_time) * 1000000) / 1000

I would expect string.format to round the value properly. But since I can't seem to get any sub millisecond timestamps from socket.gettime (on Windows), I have a hard time verifying it. For me, it appears to work fine to skip floor, and with Chronos, doing the above will reduce the displayed resolution.

I also moved the "get time" call to before the memory formatting block. This reduces the measured time elapsed since the last message with about 0.0014ms. The lowest elapsed time between messages I get now is 0.0002ms.

@Insality
Copy link
Owner

Thanks for the PR! Will check soon

@Insality Insality changed the base branch from main to develop February 28, 2024 18:52
@Insality
Copy link
Owner

All is okay, thanks!

@Insality Insality merged commit e162da6 into Insality:develop Feb 28, 2024
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.

None yet

2 participants