Gettickcount () and getcurrenttime () are only accurate to 55ms (1 Tick is 55ms). If you want to accurate to milliseconds, you should use the TimegetTime function or the QueryPerFormanceCounter function. Specific examples can refer to QA001022 "VC " using high-precision timers ", QA001813" How to implement accurate timing in Windows "and QA004842" TimegetTime function delay is not allowed ". Operating System: Win2000 programming tools: VB6 question: I use timeGetTime function, made a delay function, as follows: Private Sub DelayTime (ByVal DelayNum As Long) Dim StartTime As Double, TmpTime As Single StartTime = timeGetTime Do TmpTime = timeGetTime If TmpTime = DelayNum End Sub However, delay is not allowed! Sometimes there are more than 10 milliseconds! Is there a problem with my program written? How to correct? Level: Intermediate (Wang Hui) Although the unit of TimegetTime returns a value of 1 ms, it is actually about 10ms. If you want to increase accuracy, you can use QueryPerformanceCounter and QueryPerformanceFrequency. These two functions are not supported in each system. For systems that support them, it can be obtained below 1 ms. Windows has a very high type timer, which is accurate in microseconds, but different systems have different frequencies, this frequency is related to hardware and operating systems. The frequency of this timer can be obtained by using the API function queryperformancefrequency. The current value of the timer can be obtained by using the API function QueryperFormanceCounter. Depending on the time and the frequency of the timer to be delayed, the number of cycles passing through the time timer to be delayed can be calculated. In the cycle, the Timer value is not stopped with QueryPerFormanceCounter, and the end of the specified cycle will end the cycle, the purpose of high-precision delay is achieved.