npm (05-07-2021)
TLDR: What's a good way to time the speed of my script?
Inside a function or when I call the function?
I'm currently using performance.now() to time, should I use this?
I'm working on a main shop ABer and I'm working on solving pet captcha portion.
I know there's a publicly-available method of solving this captcha but I decided to try to work on my own.
After completing mine, I believe I might have something that's more accurate and faster.
The improved accuracy is a certainty, but I want to make sure that my captcha solving function is not slowed down by this.
How should I measure how long my function takes to solve?
This is what I'm doing currently:
Should I be timing when I call the function instead of inside the function itself?
My Userscripts:
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
npm (05-07-2021)
You should be measuring the time outside the function as you're trying to measure the total time until you get the result from the function. Btw great job I never put time into finding an optimal solution for the captcha
Last edited by npm; 05-07-2021 at 12:42 PM.
Code:404 Not Found.
Thank you, this makes sense.
Glad to say that I've completed auto-haggle + captcha completion + form submission that completes the buy page consistently in <10ms
Haggling takes about 0.1 ms
Solving captcha takes <10 ms
Practical AB speed really depends on how fast the browser loads haggle form + captcha image.
I would really LOVE to release this but tbh it's waaaaay too fast to be released for general use here for now.
I'd need to implement a random delay when buying, which I'll leave for another day.
Last edited by Shawn; 05-08-2021 at 03:22 PM.
My Userscripts:
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
npm (05-09-2021)
I'm not sure how to time your function or introduce randomized delays, but I suspect if you can create a bell curve randomized time, it would look more human than an even distribution of times. IE if use a bell curve and have a delay between 1 and 9 seconds it'll more often refresh closer to 5 seconds than it will at the extremes of 1 second and 9 seconds.
Shawn (05-08-2021)
My Userscripts:
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)
(you need an account to see links)