Commits

Stefan Scherfke  committed 2498454

Added another benchmark that I seemed to have forgotten to add ...

  • Participants
  • Parent commits 44c6310

Comments (0)

Files changed (1)

File simpy3/wait_for_proc.py

+import random
+
+import simpy
+
+
+def child(env):
+    yield env.hold(random.randint(1, 1000))
+
+
+def parent(env, num_childs):
+    childs = []
+    for i in range(num_childs):
+        childs.append(env.start(child(env)))
+
+    for child_proc in childs:
+        yield child_proc
+
+
+def benchmark(num_parents=100, num_childs=1000):
+    env = simpy.Environment()
+    for i in range(num_parents):
+        env.start(parent(env, num_childs))
+    simpy.simulate(env)