aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-01-29 21:36:14 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-01-29 22:50:02 +0100
commit16898ae997df8ff9c165f54944a85b5f3d07d2dc (patch)
tree9b34403e224b80edaf49ab2b34a407b600b8365d /global-functions.rsc
parente636d4194c44a916792da58944d89820035d9287 (diff)
global-functions: $RandomDelay: allow zero time, return immediately
Diffstat (limited to 'global-functions.rsc')
-rw-r--r--global-functions.rsc4
1 files changed, 4 insertions, 0 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index 8411fc5..a2c50a5 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -879,6 +879,10 @@
:global EitherOr;
:global GetRandomNumber;
+ :if ($Time = 0) do={
+ :return false;
+ }
+
:delay ([ $GetRandomNumber $Time ] . [ $EitherOr $Unit "s" ]);
}