Skip to content

Commit a4c63ac

Browse files
authored
Print duration of callback app (#885)
Signed-off-by: Victor Chang <[email protected]>
1 parent 387803f commit a4c63ac

File tree

1 file changed

+7
-1
lines changed
  • src/TaskManager/CallbackApp

1 file changed

+7
-1
lines changed

src/TaskManager/CallbackApp/app.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import pika
1616
import uuid
1717

18+
from time import perf_counter as pc
1819

1920
def main():
2021
parser = argparse.ArgumentParser()
@@ -50,4 +51,9 @@ def main():
5051
print('Message sent.')
5152

5253
if __name__ == "__main__":
53-
main()
54+
t0 = pc()
55+
try:
56+
main()
57+
except Exception as e:
58+
print(e)
59+
print(f"Duration: {pc()-t0}")

0 commit comments

Comments
 (0)