Skip to content

Commit f305ade

Browse files
committed
async sample added
1 parent a5d2d5f commit f305ade

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

sync.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# synchronous example
2+
3+
import time
4+
5+
def hello():
6+
print("hello")
7+
time.sleep(5) # delay 5 seconds
8+
9+
def world():
10+
print("world")
11+
time.sleep(5) # delay 5 seconds
12+
13+
def main():
14+
# call the functions
15+
hello()
16+
world() # this function is executed after the first
17+
18+
if __name__ == "__main__":
19+
main()

0 commit comments

Comments
 (0)