Is It possible get ticks number with same format like DateTime.Ticks .NET object, that is in 100ns units, in C++ ATL or MFC?
Is It possible get ticks number with same format like DateTime.Ticks .NET object, that
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
DateTime.Ticksdoes not have any implications on timer resolution, so you are not promised that timer is 100ns accurate. In C++ you have a similar value using:If you need a more accurate timer, look for
QueryPerformanceCounterbased implementation. See:UPD. As for alignment to that from .NET
Ticksproperty, see comment from Hans above – value casted/calculated from result ofGetFileTimeAPI is also in the same 100 ns units and is set offTicksproperty by a fixed constant.