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 ff10787 commit 24c8876Copy full SHA for 24c8876
1 file changed
example/01-delay-1-5-10-seconds.php
@@ -6,11 +6,14 @@
6
* with the output to the three trigger times that are added after creating
7
* the IndividualTimer object.
8
*/
9
+
10
+use Gt\Async\Loop;
11
+use Gt\Async\Timer\IndividualTimer;
12
require("../vendor/autoload.php");
13
14
$timeAtScriptStart = microtime(true);
15
-$timer = new \Gt\Async\Timer\IndividualTimer();
16
+$timer = new IndividualTimer();
17
$timer->addTriggerTime($timeAtScriptStart + 1);
18
$timer->addTriggerTime($timeAtScriptStart + 5);
19
$timer->addTriggerTime($timeAtScriptStart + 10);
@@ -21,7 +24,7 @@
21
24
echo "Number of seconds passed: $secondsPassed", PHP_EOL;
22
25
});
23
26
-$loop = new \Gt\Async\Loop();
27
+$loop = new Loop();
28
$loop->addTimer($timer);
29
echo "Starting...", PHP_EOL;
30
$loop->run();
0 commit comments