tick callbacks
| From: | André Langhorst | Date: | Sat, 02 Sep 2000 19:50:43 +0000 |
| Subject: | tick callbacks | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-31679@lists.php.net to get a copy of this message | ||
Is it intentional that one "1" (whatever it is called) is already included in the declare() statement.
Here´s the example from the last thread, slightly modified. It executes "2" times both functions,
like I´d expect...
function foo($a) { print "$a\n"; }
function zoo() {
static $i = 0;
print "I am: $i\n";
$i++; }
register_tick_function("foo", "I'm here!");
register_tick_function("zoo");
register_tick_function("zoo");
declare (ticks = 2) {
1;1;1;1; }
now modify the declare statement and add one "1", it executes 3 times...
declare (ticks = 2) {
1;1;1;1;1; }
so you can calculate the number of times your functions are beeing executed, by doing
a) add all "1" in declared *plus* one
b) divide by ticks
andré