Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Childtest vs getwinclass
#1
what is faster ?
using the str solution makes it more intuitive for me.

;/
function# iid FILTER&f
str cla.getwinclass(f.hwnd)
str childclass.getwinclass(f.hwnd2)
str win_exe.getwinexe(win());err
int+ _xm = xm
int+ _ym = ym

int+ lhwnd = f.hwnd
if(!f.hwnd2) ret -2
sel _s.getwinexe(f.hwnd) 1
,case "qm"
,,if cla="#32768"
,,,out "cla="#32768" && win_exe="explorer""
,case "devenv"
,,if(childtest(f.hwnd2 "" "VsTextEditPane"))
,,,out "childtest(f.hwnd2 "" "VsTextEditPane")"
,,,ret -1 ;;eat click
,,
,case else ret -2 ;;default action in other programs
pi
#2
Macro
Code:
Copy      Help
ARRAY(int) a
int i tavg
long t1 t2

win("" "" "" 0 0 0 a); if(!a.len) ret
out "Testing with %i windows. Average time in ns." a.len

t1=perf
for(i 0 a.len) rep(1000) _s.getwinclass(a[i]); _s.all
t2=perf; tavg=t2-t1/a.len
out "getwinclass: %i" tavg

t1=perf
for(i 0 a.len) rep(1000) wintest(a[i] "" "test class")
t2=perf; tavg=t2-t1/a.len
out "wintest(hwnd '''' ''test class''): %i" tavg

t1=perf
for(i 0 a.len) rep(1000) _s.getwintext(a[i]); _s.all
t2=perf; tavg=t2-t1/a.len
out "getwintext: %i" tavg

t1=perf
for(i 0 a.len) rep(1000) _s.getwinexe(a[i]); _s.all
t2=perf; tavg=t2-t1/a.len
out "getwinexe (filename): %i" tavg

t1=perf
for(i 0 a.len) rep(1000) _s.getwinexe(a[i] 1); _s.all
t2=perf; tavg=t2-t1/a.len
out "getwinexe (full path): %i" tavg


Forum Jump:


Users browsing this thread: 1 Guest(s)