Get ten millionths of a second
Asked Answered
C

1

0

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

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

Conker answered 26/6, 2010 at 12:40 Comment(1)
possible duplicate of Get Ticks per second and convert to String value?Annotation
L
1

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.

Lavern answered 26/6, 2010 at 12:43 Comment(6)
@Khou - It works here: DateTime.Now.ToString("fffffff"), what error are you getting?Fop
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.Conker
Getting "Cannot implicitly convert type 'System.DateTime' to 'string'"Conker
@Khou: Then you're not using the code shown. Please edit your question with the code you're actually using.Pantelegraph
@Khou - It sounds like Stopwatch is more appropriate here.Fop
@Jon, sorry you are right, my fault, i checked again and it works!Conker

© 2022 - 2024 — McMap. All rights reserved.