Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include ImageEqual.ahk
- #include <Gdip_All>
- olderror := 0
- Loop 100 {
- QPC(1)
- str := ImagePutBase64("d.bmp", "png")
- ImagePutCursor({base64:str})
- ImagePutFile(A_Cursor, "34.png")
- old += QPC()
- if not ImageEqual("34.png", str)
- olderror++
- DllCall("SystemParametersInfo", "uint", 0x57, "uint", 0, "ptr", 0, "uint", 0)
- }
- pToken := Gdip_Startup()
- newerror := 0
- Loop 100 {
- QPC(1)
- str := ImagePutBase64("d.bmp", "png")
- ImagePutCursor({base64:str})
- ImagePutFile(A_Cursor, "34.png")
- new += QPC()
- if not ImageEqual("34.png", str)
- newerror++
- DllCall("SystemParametersInfo", "uint", 0x57, "uint", 0, "ptr", 0, "uint", 0)
- }
- if (old > new)
- winner := "New Version wins by " old - new " and is " Abs(old - new)/new*100 "% faster."
- else
- winner := "Old Version wins by " new - old " and is " Abs(old - new)/old*100 "% faster."
- MsgBox % "Old Version:`t" old "`nNew Version:`t" new "`n" winner
- MsgBox % "Number of old errors:`t" olderror "`nNumber of new errors:`t" newerror
- return
- Esc:: ExitApp
- QPC( R := 0 ) { ; By SKAN, http://goo.gl/nf7O4G, CD:01/Sep/2014 | MD:01/Sep/2014
- Static P := 0, F := 0, Q := DllCall( "QueryPerformanceFrequency", "Int64P",F )
- Return ! DllCall( "QueryPerformanceCounter","Int64P",Q ) + ( R ? (P:=Q)/F : (Q-P)/F )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement