>Found this one:
>
>Private Declare Function GetTickCount Lib "kernel32" () As Long
Is not going to do it for you; in all probability, you'll need to use a high-performance counter, which is processor dependent as to exact resoultion. You'll need to use QueryPerformanceFrequency() to determine the counter interval, and QueryPerformanceCounter() to examine the current state of the high-performance counter. Both work with a 64 bit LARGE_INTEGER, qnd not all systems support the high-performance counter. You need to query the frequencyeach time you run your app; the frequency is processor and OS dependent, and may not be altered at runtime.
You may be able to use the Win32API timer-related functions. You can alter the frequency of updates to the system clock, allowing for a finer-resolution 'tick' through the SetSystemTimeAdjustment() call, and then rely on a timer. The precision of time adjustment specifications is in units of 100ns; it requires NT or Win2K, and requires that your process is granted the system-time privilege SE_SYSTEMTIME_NAME, ordinarily requiring a call to AdjustTokenPrivileges() to enable. The basic p_code:
Call OpenProcessToken(GetActiveProcess(),TOKEN_ALL_ACCESS,pTokenHandle)
Call AdjustTokenPrivileges() to enable SE_SYSTEMTIME_NAME
Call GetSystemTimeAdjustment() to get current settings
Call SetSystemTimeAdjustment() to the desired value
Call AdjustTokenPrivileges() to reset the SE_SYSTEMTIME_NAME state
Do your interval-sensitive stuff
Call AdjustTokenPrivileges() to enable SE_SYSTEMTIME_NAME
Call SetSystemTimeAdjustment() back to the initial state
Call AdjustTokenPrivileges() to reset the SE_SYSTEMTIME_NAME state
Call CloseHandle(pTokenHandle) to release the process token handle
NB: this might affect the system's time of day adjustments and display.