Skip to content

Commit 24c8876

Browse files
author
Greg Bowler
committed
Import qualifier
1 parent ff10787 commit 24c8876

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

example/01-delay-1-5-10-seconds.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
* with the output to the three trigger times that are added after creating
77
* the IndividualTimer object.
88
*/
9+
10+
use Gt\Async\Loop;
11+
use Gt\Async\Timer\IndividualTimer;
912
require("../vendor/autoload.php");
1013

1114
$timeAtScriptStart = microtime(true);
1215

13-
$timer = new \Gt\Async\Timer\IndividualTimer();
16+
$timer = new IndividualTimer();
1417
$timer->addTriggerTime($timeAtScriptStart + 1);
1518
$timer->addTriggerTime($timeAtScriptStart + 5);
1619
$timer->addTriggerTime($timeAtScriptStart + 10);
@@ -21,7 +24,7 @@
2124
echo "Number of seconds passed: $secondsPassed", PHP_EOL;
2225
});
2326

24-
$loop = new \Gt\Async\Loop();
27+
$loop = new Loop();
2528
$loop->addTimer($timer);
2629
echo "Starting...", PHP_EOL;
2730
$loop->run();

0 commit comments

Comments
 (0)