mirror of
https://github.com/autistic-symposium/web3-starter-py.git
synced 2025-05-17 22:20:22 -04:00
cleanup names for dirs
This commit is contained in:
parent
0904ec1dc4
commit
0da3cbd74a
80 changed files with 62 additions and 2263 deletions
14
boilerplates-concurrence/multiprocessing_example.py
Normal file
14
boilerplates-concurrence/multiprocessing_example.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
import time
|
||||
import random
|
||||
import multiprocessing
|
||||
|
||||
|
||||
def worker(n):
|
||||
sleep = random.randrange(1, 10)
|
||||
time.sleep(sleep)
|
||||
print("Worker {}: sleeping for {} seconds.".format(n, sleep))
|
||||
|
||||
|
||||
for i in range(5):
|
||||
p = multiprocessing.Process(target=worker, args=(i,))
|
||||
p.start()
|
Loading…
Add table
Add a link
Reference in a new issue