Hello!
I'm having a problem with my php script on my linux web server. In that
script there is a cycle with some math calculations (about ~30 steps), the
execution time is less 1 second, but the script loads the server CPU up to
90%...
I've optimized script already to the minimum math function,
Personally, I wouldn't worry about it unless it is actually interfering
with other processes. The OS will give any process or thread 100% of
the CPU if there is nothing else that needs the CPU. What does you
context switching numbers look like? If there is a lot of context
switching, then your
Well have you tried to define one function to include the for all
variables that require mt_rand()?
Jas
Brent Baisley wrote:
Personally, I wouldn't worry about it unless it is actually interfering
with other processes. The OS will give any process or thread 100% of the
CPU if there is nothing
ex.
?php
function rand($attack,$skills,$damage,$armor) {
$do = array($attack,$skills,$damage,$armor);
finish=false
while (!finish) {
$do = mt_rand(mktime(microtime(1,100)); }
while($do = list($attack,$skills,$damage,$armor)) {
calculate total damage for opponent }
}
?
I read that the use of
4 matches
Mail list logo