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

Add NextIDMono() function. #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add NextIDMono() function. #44

wants to merge 2 commits into from

Conversation

ccfuncy
Copy link

@ccfuncy ccfuncy commented May 6, 2023

Description:

This pull request addresses issue #39.

Task items:

  1. define startTimeMono variable
  2. Add NextIDMono,currentElapsedTimeMono function
  3. Update test case

@theory
Copy link
Contributor

theory commented Oct 10, 2023

I wonder if it'd be better just to replace the existing time tracking with the mono time tracking.

@ccfuncy
Copy link
Author

ccfuncy commented Oct 11, 2023

I wonder if it'd be better just to replace the existing time tracking with the mono time tracking.

I think the performance is comparable, but the monotonic clock has a flaw, that is, the time parsed from the string does not have a monotonic clock, so the StartTime setting is not that smart, but except for this flaw, the performance of the two clocks is comparable, but I did not have time to test it, it is just in theory.

@theory
Copy link
Contributor

theory commented Oct 11, 2023

the time parsed from the string does not have a monotonic clock, so the StartTime setting is not that smart

Is there a better solution without the flaw?

@ccfuncy
Copy link
Author

ccfuncy commented Nov 29, 2023

I'm sorry I haven't been able to get back to you these past few months because I've been so busy with my papers

I have not found a better solution,Because mono time depends on the computer time hop, and the computer switch is related, I think it is not a perfect substitute for ordinary time, can only be used as a solution in harsh environment.

从字符串解析的时间没有单调时钟,因此 StartTime 设置不是那么聪明

有没有更好且没有缺陷的解决方案?

@ccfuncy
Copy link
Author

ccfuncy commented Nov 29, 2023

Is there a better solution without the flaw?

But I think there will be a solution because in the go time source code is also such two time design, I think we can find a balance between the two times

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