Skip to content

Commit fdf007d

Browse files
committed
Fix usage of removed timer methods
1 parent e18ee06 commit fdf007d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

examples/95-benchmark-memory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
$runs = 0;
2727

2828
if (5 < $t) {
29-
$loop->addTimer($t, function (TimerInterface $timer) {
30-
$timer->getLoop()->stop();
29+
$loop->addTimer($t, function () use ($loop) {
30+
$loop->stop();
3131
});
3232

3333
}
3434

3535
$loop->addPeriodicTimer(0.001, function () use (&$runs, $loop) {
3636
$runs++;
3737

38-
$loop->addPeriodicTimer(1, function (TimerInterface $timer) {
39-
$timer->cancel();
38+
$loop->addPeriodicTimer(1, function (TimerInterface $timer) use ($loop) {
39+
$loop->cancelTimer($timer);
4040
});
4141
});
4242

0 commit comments

Comments
 (0)