Skip to content

Commit f948648

Browse files
committed
Add notes about timers
1 parent c98af47 commit f948648

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/Loop.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ public static function defer(callable $callback, $data = null)
125125
}
126126

127127
/**
128-
* Delay the execution of a callback. The time delay is approximate and accuracy is not guaranteed.
128+
* Delay the execution of a callback.
129+
*
130+
* The delay is a minimum and approximate, accuracy is not guaranteed.
129131
*
130132
* @param int $time The amount of time, in milliseconds, to delay the execution for.
131133
* @param callable(string $watcherId, mixed $data) $callback The callback to delay.
@@ -139,7 +141,10 @@ public static function delay($time, callable $callback, $data = null)
139141
}
140142

141143
/**
142-
* Repeatedly execute a callback. The interval between executions is approximate and accuracy is not guaranteed.
144+
* Repeatedly execute a callback.
145+
*
146+
* The interval between executions is a minimum and approximate, accuracy is not guaranteed.
147+
* The first execution is scheduled after the first interval period.
143148
*
144149
* @param int $interval The time interval, in milliseconds, to wait between executions.
145150
* @param callable(string $watcherId, mixed $data) $callback The callback to repeat.

src/LoopDriver.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function defer(callable $callback, $data = null);
4040
/**
4141
* Delay the execution of a callback.
4242
*
43-
* The time delay is approximate and accuracy is not guaranteed.
43+
* The delay is a minimum and approximate, accuracy is not guaranteed.
4444
*
4545
* @param int $delay The amount of time, in milliseconds, to delay the execution for.
4646
* @param callable(string $watcherId, mixed $data) $callback The callback to delay.
@@ -53,7 +53,8 @@ public function delay($delay, callable $callback, $data = null);
5353
/**
5454
* Repeatedly execute a callback.
5555
*
56-
* The interval between executions is approximate and accuracy is not guaranteed.
56+
* The interval between executions is a minimum and approximate, accuracy is not guaranteed.
57+
* The first execution is scheduled after the first interval period.
5758
*
5859
* @param int $interval The time interval, in milliseconds, to wait between executions.
5960
* @param callable(string $watcherId, mixed $data) $callback The callback to repeat.

0 commit comments

Comments
 (0)