fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39880?usp=email )
Change subject: library: add f_rnd_sleep() ......................................................................
library: add f_rnd_sleep()
Change-Id: I97474d0c39052d8a9dd294238530e0b6c31a19e0 --- M library/Osmocom_Types.ttcn 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve
diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index 61b1e52..995342a 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -113,6 +113,10 @@ return prefix & f_rnd_octstring(len - lengthof(prefix)); }
+function f_rnd_sleep(float max_seconds) { + f_sleep(rnd() * max_seconds); +} + function f_sleep(float seconds) { timer T := seconds; T.start;