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 8395d24 commit 37f5887Copy full SHA for 37f5887
Multiprocessing/S01-Process/S01-01-sequential-example.py
@@ -0,0 +1,20 @@
1
+import time
2
+
3
4
+def some_task(name):
5
+ print(f"Process {name} Started.")
6
+ for i in range(0, 100000000):
7
+ pass
8
+ print(f"Process {name} Finished.")
9
10
11
+start = time.perf_counter()
12
+some_task("One")
13
+some_task("Two")
14
+some_task("Three")
15
+some_task("Four")
16
+end = time.perf_counter()
17
+exe_time = end - start
18
+print(f"Execution Time: {exe_time} sec")
19
20
+# for example: Execution Time: 14.556302800003323 sec
0 commit comments