We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import time import gevent n = 1000000 def worker(): for _ in range(n): gevent.sleep(0) start_time = time.process_time_ns() greenlet = gevent.spawn(worker) for _ in range(n): gevent.sleep(0) end_time = time.process_time_ns() switch_time = (end_time - start_time)/(2*n) print("Context switch time:", switch_time, "ns")
Is there a better way to measure loop scheduling time? Or does gevent itself provide this metric?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is there a better way to measure loop scheduling time? Or does gevent itself provide this metric?
The text was updated successfully, but these errors were encountered: