Sign in to follow this  
Followers 0
corgano

PixelGetColor() slowed down and no idea why

3 posts in this topic

#1 ·  Posted

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#3 ·  Posted

i think its only in your side, tested it and its working fast.


ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
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
Sign in to follow this  
Followers 0