How long is a .NET DateTime/TimeSpan tick?
+6
A:
The tick is the unit of granularity for the .NET DateTime and TimeSpan value types.
It has the following common conversions:
1 tick * 1E+2 = 100 nanoseconds
1 tick * 1E-1 = 0.1 microseconds
1 tick * 1E-4 = 0.0001 milliseconds
1 tick * 1E-7 = 0.0000001 seconds
binarycoder
2009-06-05 15:26:52
You answered your own question one minute after posting it?
Lance McNearney
2009-06-05 16:24:25
-1 badge farming
Dan Fuller
2009-06-05 16:41:03
uh, StackOverflow encourages this sort of thing in the FAQ, dont down vote him for that.see: http://stackoverflow.com/questions/18557/how-does-stackoverflow-work-the-unofficial-faq#119658
Allen
2009-06-05 16:46:08
+12
A:
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)
jerryjvl
2009-06-05 15:38:37
This is true. Don't hard code these in your code. However, they are absolute and will not be changed by Microsoft. The reason for this post is that sometimes one needs to do this math on a calculator and I wanted to make this chart available.
binarycoder
2009-06-05 17:17:28