Discussion: confused by php ticks
Afficher un message
Vieux 26/03/2008, 17h17   #1
actioncem@googlemail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut confused by php ticks

I am discovering some really weird behaviour of php while using ticks
and register_tick_function(). I've already searched the web and some
newsgroups, but I didn't find any suitable postings for my problem.

Here comes an example script:

<?php

// define tick function
function checkUsage() {
echo ".";
}

// register tick function
register_tick_function('checkUsage');

// declare ticks
declare(ticks = 1);

for($i = 0; $i < 1000; $i++) {
echo '|';
}

?>

If you execute this script, you can see, that php is doing some ticks
before the for-loop passes by the first time. That's no problem - yet.
If I execute the script immediately again, the ticks between the loop
passes counting higher and higher. I need to wait about one minute
till the output is as expected.

Can someone explain that to me?

Cheers,

Cem

P.S.: I'm sorry for my poor english
  Réponse avec citation
 
Page generated in 0,04683 seconds with 9 queries