How to ensure a timestamp is always unique?

后端 未结 6 588
夕颜
夕颜 2020-12-01 00:18

I\'m using timestamps to temporally order concurrent changes in my program, and require that each timestamp of a change be unique. However, I\'ve discovered that simply call

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 00:58

    It can't be guaranteed to be unique, but is perhaps using ticks is granular enough?

    A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond.

提交回复
热议问题