Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Everyone,


I have done lots of search in Google and i could not find the answer, how to get the current time with microseconds precision.


Example: HH:MM::SS::MMM::Microseconds.

Let me know,if anyone have idea or suggestions.

Regards,
Ranjith
Posted
Comments
ranjithkumar81 10-Jan-14 1:34am    
Is there anyway to measure time in microseconds precision in windows

Windows does not support microsecond time resolution with time stamps. High resolutions are only supported for time spans (e.g. by the performance counter). The Windows Timestamp Project[^] has a very good explanation about the resolutions that can be achieved.
 
Share this answer
 
Comments
nv3 9-Jan-14 5:22am    
Interesting article, thanks for the link, Jochen.
DateTime.Now.ToString("HH:MM:ss::ffffff")

Reference : Time in microseconds[^]
 
Share this answer
 
Comments
ranjithkumar81 9-Jan-14 2:10am    
you are not understanding my question.

I need a current time with format like= hour:minute:second:milliseconnds:microseconds.
and not find the difference between two processing time.
Karthik_Mahalingam 9-Jan-14 2:15am    
chk this.
DateTime.Now.ToString("HH:MM:ss:fff:ffffff")
ranjithkumar81 9-Jan-14 2:58am    
not getting proper value while dumping into file
Karthik_Mahalingam 9-Jan-14 3:22am    
post your code.
ranjithkumar81 9-Jan-14 3:58am    
i am getting proper value . format like
DateTime.Now.ToString("HH:mm:ss.fff.ffffff");

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900