The MASM Forum

General => The Workshop => Topic started by: MtheK on February 05, 2014, 12:10:47 AM

Title: Does MASM support the WINAPI QueryThreadCycleTime ?
Post by: MtheK on February 05, 2014, 12:10:47 AM
  I can't seem to find it in .inc, .lib, etc.

  GetThreadTimes works great and helps to explain batch response time,
matches PROCMONs' 'Thread Exit' times, GetTickCount, and GetLocalTime,
but all are Wall-Clock times.

  QueryThreadCycleTime appears to be CPUR (real) in the IBM M/F world,
which helps to see more "absolute" (non-interference) and "average" times
to determine if any coding tuning actually helps...
Title: Re: Does MASM support the WINAPI QueryThreadCycleTime ?
Post by: jj2007 on February 05, 2014, 12:33:25 AM
It's Vista upwards. If that isn't a problem, link to it dynamically (Kernel32.dll).
Title: Re: Does MASM support the WINAPI QueryThreadCycleTime ?
Post by: dedndave on February 05, 2014, 02:55:46 AM
...or use Michael's timing macros (which use RDTSC)

http://masm32.com/board/index.php?topic=49.0 (http://masm32.com/board/index.php?topic=49.0)
Title: Re: Does MASM support the WINAPI QueryThreadCycleTime ?
Post by: TWell on February 05, 2014, 04:28:21 AM
Is that function wrapper of NtQueryInformationThread from ntdll.dll with ThreadInformationClass of ThreadCycleTime ?
Title: Re: Does MASM support the WINAPI QueryThreadCycleTime ?
Post by: MtheK on February 06, 2014, 07:09:15 AM
  Thankx for the NT info and dynamic CALL suggestion; those, w/GetVersionEx & DUMPBIN, works great.