Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1import logging 

2 

3 

4def display_profiling(): 

5 try: 

6 import resource 

7 

8 usage = resource.getrusage(resource.RUSAGE_SELF) 

9 print("Profiling:") 

10 print(f"System Time: {usage.ru_stime:.4g}s") 

11 print(f"User Time: {usage.ru_utime:.4g}s") 

12 print(f"Max RSS: {usage.ru_maxrss} (units dependent on system)") 

13 except: 

14 logging.error("Profiling information could not be displayed.")