I am searching how to format time including microseconds.
I’m using class DateTime, it allowes (using properties) to get data till miliseconds, which is not enougth.
I tried using Ticks, but I didn’t know how to translate it to microseconds.
I am searching how to format time including microseconds. I’m using class DateTime, it
Share
You can use
"ffffff"in a format string to represent microseconds:To convert a number of ticks to microseconds, just use:
If these don’t help you, please provide more information about exactly what you’re trying to do.
EDIT: I originally multiplied
ticksby 1000 to avoid losing accuracy when dividingTimeSpan.TicksPerMillisecondby 1000. However, It turns out that theTicksPerMillisecondis actually a constant value of 10,000 – so you can divide by 1000 with no problem, and in fact we could just use: