Post by jeeswg » 22 Sep 2017, 14:36
SpoilerCode: Select all
q:: ;Sleep via Loop
SetBatchLines, -1
ListLines, Off
vNum := 0
DllCall("QueryPerformanceFrequency", Int64P,vQPF)
DllCall("QueryPerformanceCounter", Int64P,vQPC1)
vSec := 5
Loop, % 33000000 * vSec
{
}
DllCall("QueryPerformanceCounter", Int64P,vQPC2)
MsgBox, % (((vQPC2-vQPC1)/vQPF)*1000)
return
;==================================================
w:: ;Sleep via ping
SetBatchLines, -1
ListLines, Off
vNum := 0
DllCall("QueryPerformanceFrequency", Int64P,vQPF)
DllCall("QueryPerformanceCounter", Int64P,vQPC1)
vSec := 5
RunWait, % "cmd.exe /c ping 127.0.0.1 -n " Round(vSec+1) " > nul",, Hide
DllCall("QueryPerformanceCounter", Int64P,vQPC2)
MsgBox, % (((vQPC2-vQPC1)/vQPF)*1000)
return
Also interesting:
[SMF] Short My Function - Seconds to string - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=29505
[spoiler][code]
q:: ;Sleep via Loop
SetBatchLines, -1
ListLines, Off
vNum := 0
DllCall("QueryPerformanceFrequency", Int64P,vQPF)
DllCall("QueryPerformanceCounter", Int64P,vQPC1)
vSec := 5
Loop, % 33000000 * vSec
{
}
DllCall("QueryPerformanceCounter", Int64P,vQPC2)
MsgBox, % (((vQPC2-vQPC1)/vQPF)*1000)
return
;==================================================
w:: ;Sleep via ping
SetBatchLines, -1
ListLines, Off
vNum := 0
DllCall("QueryPerformanceFrequency", Int64P,vQPF)
DllCall("QueryPerformanceCounter", Int64P,vQPC1)
vSec := 5
RunWait, % "cmd.exe /c ping 127.0.0.1 -n " Round(vSec+1) " > nul",, Hide
DllCall("QueryPerformanceCounter", Int64P,vQPC2)
MsgBox, % (((vQPC2-vQPC1)/vQPF)*1000)
return
[/code][/spoiler]
Also interesting:
[SMF] Short My Function - Seconds to string - AutoHotkey Community
[url]https://autohotkey.com/boards/viewtopic.php?f=5&t=29505[/url]