I remember that in an update, the load time was reduced to about 10MS.
Where did it change?
=======
NewThread also seems to have changed. At its fastest, it was about 6MS, now it is 60MS.
MsgBox NewThread("MsgBox ahktime(" ahktime() ")")
Code: Select all
r:=ahkdll()
MsgBox r.new("MsgBox ahktime(" ahktime() ")")
ahkdll(){
static dll:=(UnZipRawMemory(LockResource(hr:=LoadResource(0,s:=FindResource(0,"F903E44B8A904483A1732BA84EA6191F",10))),SizeofResource(0,s),dll),FreeResource(hr),dll)
return (t:=CriticalObject(),
t.%""%:=r:=MemoryLoadLibrary(&dll),
t.DefineMethod("func",DynaCall(MemoryGetProcAddress(r,"ahkFunction"),"s==sssssssssss")),
t.DefineMethod("post",DynaCall(MemoryGetProcAddress(r,"ahkPostFunction"),"i==sssssssssss")),
t.DefineMethod("new",DynaCall(MemoryGetProcAddress(r,"ahktextdll"),"ut==sss")),
t.DefineMethod("add",DynaCall(MemoryGetProcAddress(r,"addScript"),"ut==si")),
t.DefineMethod("exec",DynaCall(MemoryGetProcAddress(r,"ahkExec"),"ut==sui")),
t.DefineMethod("get",DynaCall(MemoryGetProcAddress(r,"ahkgetvar"),"s==sui")),
t.DefineMethod("set",DynaCall(MemoryGetProcAddress(r,"ahkassign"),"ui==ss")),
t.DefineMethod("sub",DynaCall(MemoryGetProcAddress(r,"ahkLabel"),"ui==sui")),
t.DefineMethod("pause",DynaCall(MemoryGetProcAddress(r,"ahkPause"),"i==s")),
t.DefineMethod("exit",DynaCall(MemoryGetProcAddress(r,"ahkTerminate"),"i==i")),
t.DefineMethod("ready",DynaCall(MemoryGetProcAddress(r,"ahkReady"),"")),
t.DefineMethod("reload",DynaCall(MemoryGetProcAddress(r,"ahkReload"),"i==i")),t)
}
ahkTime(s:=0,i:=6){
static r:=(QueryPerformanceFrequency(getvar(r:=0)),r)
QueryPerformanceCounter(getvar(n:=0))
if !i
{
p:=s/1000*r,n2:=n,c:=A_IsCritical,Critical("on")
if s>15
sleep(((s-5)//15)*15)
while ((n2-n)<p)
QueryPerformanceCounter(getvar(n2:=0))
Return (Critical("c"),Round((n2-n)/r, 6))
}
Return (s ? Round((n-s)/r, i) : n)
}