Skip to content

Commit c7e2298

Browse files
committed
Update python example using iterations
1 parent 8e39892 commit c7e2298

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

examples/python/a_module/fast_file.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/python/a_module/foo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from util import work
2+
3+
def foo(duration):
4+
work(duration)

examples/python/b_module/bar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from util import work
2+
3+
def bar(duration):
4+
work(duration)

examples/python/b_module/slow_file.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/python/main.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
import time
22
import threading
3-
from a_module.fast_file import fast_function
4-
from b_module.slow_file import slow_function
3+
from a_module.foo import foo
4+
from b_module.bar import bar
55

6-
ITERATIONS = 20000
6+
ITERATIONS = 200000
77

88
if __name__ == "__main__":
9+
910
print(f'yoyoy Application 1 started')
1011
for i in range(ITERATIONS):
11-
fast_function(25000)
12-
slow_function(8000)
12+
foo(75000)
13+
bar(25000)
1314
print(f'yoyoy Application 1 ended')
1415

1516
print(f'Switching fast and slow around.....')
@@ -18,6 +19,6 @@
1819

1920
print(f'yoyoy Application 2 started')
2021
for i in range(ITERATIONS):
21-
fast_function(25000)
22-
slow_function(75000)
22+
bar(25000)
23+
foo(8000)
2324
print(f'yoyoy Application 2 ended')

0 commit comments

Comments
 (0)