You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the timing.py, you can use this code snippet instead, it gives you almost the same result:
def _get_cpu_time() -> float:
"""
Generates the cpu time to report. Adds the user and system time, following the implementation from timing-asgi
"""
return time.process_time()
Describe the bug
Fails completely on Windows because
resource
is not available on Windows.To Reproduce
Steps to reproduce the behavior:
pip install fastapi-utils
2.
from fastapi_utils.timing import add_timing_middleware
Expected behavior
The import works.
Environment:
Additional context
https://stackoverflow.com/questions/37710848/importerror-no-module-named-resource
The text was updated successfully, but these errors were encountered: