views:

72

answers:

1

How do I get the string value of the ten millionths of a second? "fffffff"

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

+1  A: 

myDateTime.ToString("fffffff") should work. Is that giving some sort of error?

Also, this is from the page you linked

Although it is possible to display the ten millionths of a second component of a time value, that value may not be meaningful. The precision of date and time values depends on the resolution of the system clock. On the Windows NT 3.5 (and later) and Windows Vista operating systems, the clock's resolution is approximately 10-15 milliseconds.

Greg
yes it is :( ..
K001
@Khou - It works here: `DateTime.Now.ToString("fffffff")`, what error are you getting?
Nick Craver
Didn't need it to be meaningful, just need a counter to count up using time. Need at least 7 to 8 digits, so 00000001 to 99999999.
K001
Getting "Cannot implicitly convert type 'System.DateTime' to 'string'"
K001
@Khou: Then you're not using the code shown. Please edit your question with the code you're actually using.
Jon Skeet
@Khou - It sounds like [`Stopwatch`](http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx) is more appropriate here.
Nick Craver
@Jon, sorry you are right, my fault, i checked again and it works!
K001