Usage: @profile("my_func") def my_func(): code
(n)
| 301 | |
| 302 | |
| 303 | def profile(n): |
| 304 | """ |
| 305 | Usage: |
| 306 | @profile("my_func") |
| 307 | def my_func(): code |
| 308 | """ |
| 309 | |
| 310 | def decorator_with_name(func): |
| 311 | def func_wrapper(*args, **kwargs): |
| 312 | with profile_kv(n): |
| 313 | return func(*args, **kwargs) |
| 314 | |
| 315 | return func_wrapper |
| 316 | |
| 317 | return decorator_with_name |
| 318 | |
| 319 | |
| 320 | # ================================================================ |
nothing calls this directly
no outgoing calls
no test coverage detected