How to get High Accurate/close to accuracy timestamp in MICROSECONDS(system time) in a multithreaded/threadsafe C programming in windows 7 (In 2015).
Probably timestamp could be Year:Day:Month:Hour:Mins:Secs:Millisecs:Microsecs
How to get High Accurate/close to accuracy timestamp in MICROSECONDS(system time) in a multithreaded/threadsafe C programming in windows 7 (In 2015).
Probably timestamp could be Year:Day:Month:Hour:Mins:Secs:Millisecs:Microsecs
If you're looking for real-world timestamps and not just time-interval-measurement (as suggested by your comment that timestamps could be in Year:Day:Month:Hour:Mins:Secs:Millisecs:Microsecs format), then GetSystemTimeAsFileTime() is probably the best thing you're going to get. It populates a FILETIME struct, which uses units of 100nS, although the actual resolution of the data provided is almost certainly not going to be as high-resolution as the FILETIME struct's units would imply (apparently the designer of the FILETIME struct wanted to leave plenty of room for future improvement!)
Once you have your FILETIME object, you can then convert it to a SYSTEMTIME object using FileTimeToSystemTime(). The SYSTEMTIME object breaks the time out into year/month/day/hours/minutes/seconds/milliseconds fields (sorry, no microseconds).
On the other hand, if your purpose is actually only to measure time intervals , and you don't need to match them to absolute real-world dates/times, then you have some other options. The most precise API would be QueryPerformanceCounter(), but even then I wouldn't get my hopes up too high -- Windows is not a real-time OS, and its lack of real-time performance will be reflected in the quality of the results you get from it.