This is efficient?
#7

Well, it really depends on the amount of businesses you actually have vs. the amount of max businesses defined in the script.

If you have a max business value of 100, while you only have 15 valid businesses you'll have a chance of waiting a very long time before the randomizer finally hits one of the valid businesses, it can take up to minutes if not hours or days. I would rather grab a random value based on an enum length, so in this case you'll end up like this:

PHP код:
new random(sizeof(BusinessData)); 
I haven't tested it, but in theory this should work a lot more efficient, once I have the chance to do so I'll do some benchmarking tests comparing your method with mine.
Reply


Messages In This Thread
This is efficient? - by StreK - 02.05.2017, 06:47
Re: This is efficient? - by iLearner - 02.05.2017, 06:53
Respuesta: Re: This is efficient? - by StreK - 02.05.2017, 06:56
Re: This is efficient? - by iLearner - 02.05.2017, 06:57
Re: This is efficient? - by SyS - 02.05.2017, 06:58
Re: This is efficient? - by DRIFT_HUNTER - 02.05.2017, 07:31
Re: This is efficient? - by Duco - 02.05.2017, 09:13
Re: This is efficient? - by Logic_ - 02.05.2017, 10:20
Re: This is efficient? - by Vince - 02.05.2017, 15:17
Respuesta: Re: This is efficient? - by StreK - 02.05.2017, 22:50

Forum Jump:


Users browsing this thread: 2 Guest(s)