File: threads.py

package info (click to toggle)
pprofile 2.1.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 512 kB
  • sloc: python: 2,928; sh: 41; makefile: 3
file content (17 lines) | stat: -rwxr-xr-x 232 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python
import threading
import time

def func():
  time.sleep(1)

def func2():
  pass

t1 = threading.Thread(target=func)
t2 = threading.Thread(target=func)
t1.start()
t2.start()
(func(), func2())
t1.join()
t2.join()