sonyflake icon indicating copy to clipboard operation
sonyflake copied to clipboard

Add NextIDMono() function.

Open ccfuncy opened this issue 1 year ago • 5 comments

Description:

This pull request addresses issue #39.

Task items:

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

ccfuncy avatar May 06 '23 08:05 ccfuncy

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

theory avatar Oct 10 '23 22:10 theory

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.

ccfuncy avatar Oct 11 '23 01:10 ccfuncy

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?

theory avatar Oct 11 '23 20:10 theory

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 avatar Nov 29 '23 06:11 ccfuncy

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

ccfuncy avatar Nov 29 '23 06:11 ccfuncy