We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e18ee06 commit fdf007dCopy full SHA for fdf007d
1 file changed
examples/95-benchmark-memory.php
@@ -26,17 +26,17 @@
26
$runs = 0;
27
28
if (5 < $t) {
29
- $loop->addTimer($t, function (TimerInterface $timer) {
30
- $timer->getLoop()->stop();
+ $loop->addTimer($t, function () use ($loop) {
+ $loop->stop();
31
});
32
33
}
34
35
$loop->addPeriodicTimer(0.001, function () use (&$runs, $loop) {
36
$runs++;
37
38
- $loop->addPeriodicTimer(1, function (TimerInterface $timer) {
39
- $timer->cancel();
+ $loop->addPeriodicTimer(1, function (TimerInterface $timer) use ($loop) {
+ $loop->cancelTimer($timer);
40
41
42
0 commit comments