如何更精确sleep

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 如何更精确sleep

Re: 如何更精确sleep

by sikongshan » 25 Jun 2022, 20:24

学习的过程更重要、学到的东西更多。 :)

Re: 如何更精确sleep

by williams » 24 Jun 2022, 13:06

应该去英文区提问的,那里人多

另外这个其实文档中就有写,不用找一天,是不是更气了哈哈哈
https://wyagd001.github.io/zh-cn/docs/commands/Sleep.htm
图片.png
图片.png (163.82 KiB) Viewed 4319 times

Re: 如何更精确sleep

by kakaka » 23 Jun 2022, 13:49

Code: Select all

TimePeriod = 1
DllCall("Winmm\timeBeginPeriod", UInt, TimePeriod)



Sleep(value)


sleep(duration)
{
	SleepDuration:= duration ;
	DllCall("Sleep", UInt, SleepDuration)  ; 
	DllCall("WinmmtimeEndPeriod", UInt, TimePeriod)  ; 
}
[Mod edit: [code][/code] tags added.]
---------------------------------------------------------------------------
论坛没人啊,自己找资料了一天,解决问题了。代码里value里填写你需要的延时的睡眠,比如1ms,2ms,10ms,100ms.将Sleep(value)自己设定赋予到你脚本中需要延时的地方。

Re: 如何更精确sleep

by kakak » 20 Jun 2022, 12:07

怎样解决的?

如何更精确sleep

by kakak » 20 Jun 2022, 11:14

如何更精确sleep,求解。
已知AHK自身的sleep精度到10ms就差不多了,如果我们要提高sleep精度到1ms,该如何做

Top