.NET DateTime/TimeSpan 的刻度是多长时间?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/956483/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How long is a .NET DateTime/TimeSpan tick?
提问by Jason Kresowaty
How long is a .NET DateTime/TimeSpan tick?
.NET DateTime/TimeSpan 的刻度是多长时间?
回答by jerryjvl
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)
虽然目前一个滴答是 100 纳秒,但最好不要将其作为绝对值。而是使用“ TimeSpan.TicksPerSecond”(或任何其他 TicksPerXxx 成员值)
回答by Jason Kresowaty
回答by Colonel Panic
回答by utunga
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.
请注意,虽然 DateTime.Now 的理论分辨率相当高,但分辨率(即更新频率)却低了很多。
Apparently, on modern systems, DateTime.Now has a resolution of 10 milliseconds... See msdn.microsoft.com/en-us/library/system.datetime.now.aspx
显然,在现代系统上,DateTime.Now 的分辨率为 10 毫秒...请参阅msdn.microsoft.com/en-us/library/system.datetime.now.aspx

