开发者

Using ticks to measure absolute time

I need to way to get a very precise 开发者_如何转开发measurement of current time. The tick value seems to be perfect for this, but the most common way to get it (DateTime.Now) seems to have a fairly loose tolerance (approx ~16ms from what I can tell). There are examples out there that use the StopWatch class to measure deltas using the high resolution timers, but nothing about using those same high resolution counters to measure the current time as ticks.

Is there any way to get the current time as ticks that is more precise than DateTime.Now.Ticks?


See this earlier answer:

How to get timestamp of tick precision in .NET / C#?

This answer uses a running StopWatch in conjunction with DateTime.Now to give hyper-accurate timing, but it has issues (see all the comments).


After a fair bit of research, I think that I am hosed. While I can use the methods suggested to track elapsed time, it can't be compared between machines. As MusiGenesis comments, having the high precision timer doesn't really help with what time it is.

Thanks for the answers all

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜