How long is a .NET DateTime/TimeSpan tick?

懵懂的女人 提交于 2019-12-03 11:27:38

问题


How long is a .NET DateTime/TimeSpan tick?


回答1:


Although currently a tick is 100 nanoseconds, it is best not to rely on this as an absolute. Rather, use 'TimeSpan.TicksPerSecond' (or any of the other TicksPerXxx member values)




回答2:


The tick is the unit of granularity for the .NET DateTime and TimeSpan value types.

It has the following common conversions:

1 tick = 100 nanoseconds
       = 0.1 microseconds
       = 0.0001 milliseconds
       = 0.0000001 seconds



回答3:


To quote MSDN:

The smallest unit of time is the tick, which is equal to 100 nanoseconds.

Metrology fail.




回答4:


Note that, although the theoretical resolution of DateTime.Now is quite high, the resolution - ie how often it is updated - it quite a bit lower.

Apparently, on modern systems, DateTime.Now has a resolution of 10 milliseconds... See msdn.microsoft.com/en-us/library/system.datetime.now.aspx



来源:https://stackoverflow.com/questions/956483/how-long-is-a-net-datetime-timespan-tick

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!