i want to get time of my system with accuracy of micro second in c# How can i get this? i can get normal time but it's not enough for me.
string ZamanShoru = DateTime.Now.ToString("H:mm:ss")
i want to get time of my system with accuracy of micro second in c# How can i get this? i can get normal time but it's not enough for me.
string ZamanShoru = DateTime.Now.ToString("H:mm:ss")
According to the corresponding description of DateTime.Ticks in the MSDN you can use this property to get a resolution of one hundred of a millisecond.
A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond, or 10 million ticks in a second.
Just use the "fff" Custom Format Specifier or any number of f you require.
string ZamanShoru = DateTime.Now.ToString("H:mm:ss.ffff")