Skip to content

Add NextIDMono() function.#44

Open
ccfuncy wants to merge 2 commits into
sony:masterfrom
ccfuncy:fix
Open

Add NextIDMono() function.#44
ccfuncy wants to merge 2 commits into
sony:masterfrom
ccfuncy:fix

Conversation

@ccfuncy

@ccfuncy ccfuncy commented May 6, 2023

Copy link
Copy Markdown

Description:

This pull request addresses issue #39.

Task items:

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

@theory

theory commented Oct 10, 2023

Copy link
Copy Markdown
Contributor

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

@ccfuncy

ccfuncy commented Oct 11, 2023

Copy link
Copy Markdown
Author

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

theory commented Oct 11, 2023

Copy link
Copy Markdown
Contributor

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

ccfuncy commented Nov 29, 2023

Copy link
Copy Markdown
Author

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

ccfuncy commented Nov 29, 2023

Copy link
Copy Markdown
Author

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.

3 participants