请教延时问题?
使用Declare Sleep IN kernel32 INTEGER dwMilliseconds或木瓜老师Set Library To myFll
Sleep(1) 大约16ms左右
使用inkey()大约70ms左右
请问还有其他方法吗?
吹水佬版主提过要更高精度的可试试API的QueryPerformanceCounter()或QueryPerformanceFrequency()这两个怎么用?
谢谢
DECLARE long QueryPerformanceFrequency IN kernel32 string@ DECLARE long QueryPerformanceCounter IN kernel32 string@ large = REPLICATE(0h00,8) QueryPerformanceFrequency(@large) nFreq = CTOBIN(LEFT(large,4),"4rs") QueryPerformanceCounter(@large) nBegin = CTOBIN(LEFT(large,4),"4rs") QueryPerformanceCounter(@large) nEnd = CTOBIN(LEFT(large,4),"4rs") DO WHILE ((nEnd - nBegin) / nFreq) < 0.001 QueryPerformanceCounter(@large) nEnd = CTOBIN(LEFT(large,4),"4rs") ENDDO ? (nEnd - nBegin) / nFreq
[此贴子已经被作者于2023-4-13 15:50编辑过]