sonyflake
sonyflake copied to clipboard
Add NextIDMono() function.
Description:
This pull request addresses issue #39.
Task items:
- define
startTimeMono
variable - Add
NextIDMono,currentElapsedTimeMono
function - Update test case
I wonder if it'd be better just to replace the existing time tracking with the mono time tracking.
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.
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?
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 设置不是那么聪明
有没有更好且没有缺陷的解决方案?
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