TimerCount

3.1

  #include <toolhelp.h>    

  BOOL TimerCount(lpti)    
  TIMERINFO FAR* lpti; /* address of structure for execution times */

The TimerCount function fills the specified structure with the execution times of the current task and VM (virtual machine).

Parameters

lpti

Points to the TIMERINFO structure that will receive the execution times. The TIMERINFO structure has the following form:

#include <toolhelp.h>

typedef struct tagTIMERINFO {  /* ti */
    DWORD dwSize;
    DWORD dwmsSinceStart;
    DWORD dwmsThisVM;
} TIMERINFO;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Comments

The TimerCount function provides a consistent source of timing information, accurate to the millisecond. In enhanced mode, TimerCount uses the VTD (virtual timer device) to obtain accurate execution times.

In standard mode, TimerCount calls the GetTickCount function, which returns information accurate to one clock tick (approximately 55 ms). TimerCount then reads the hardware timer to estimate how many milliseconds remain until the next clock tick. The resulting time is accurate to 1 ms.

Before calling TimerCount, an application must initialize the TIMERINFO structure and specify its size, in bytes, in the dwSize member.

See Also

GetTickCount