Jump to content

PixelGetColor() slowed down and no idea why


Recommended Posts

I was programming and suddenly my script started going much slower than usual. I was able to narrow it down to PixelGetColor(). For some reason even the most basic example is taking a long time, but earlier today it was working nice and fast, and i can't figure out why.

In this example, each pixelGetColor took 145ms, when earlier today it took around 10ms. Any ideas?

$timer=TimerInit()
$temp = 0
For $temp = 1 to 40
$color = Hex(PixelGetColor(0, $temp), 6)
Next
ConsoleWrite("w took "&TimerDiff($timer)&"  "&$temp&"   "&Round(TimerDiff($timer)/$temp, 4)&@CRLF)


 

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

After restarting my computer, pixelGetColor() in the above example took 16.039 ms. IS there some kind of known bug / memory leak in pixelGetColor that isn't documented?

Edited by corgano

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...