Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Feature or enhancement
Proposal:
Actually, this is a performance bug. Not a feature/enhancement.clock_gettime_ns() does not use floating point operations and should be faster than oldgettimeofday(). Unfotunately in Python it's not so. Checked in Linux X86_64 kernel 6.5.7, CPython 3.11.6
In [11]:timeittime.clock_gettime_ns(0)# CLOCK_REALTIME55.4ns ±1.22nsperloop (mean ±std.dev.of7runs,10,000,000loopseach)In [12]:timeittime.clock_gettime_ns(5)# CLOCK_REALTIME_COARSE45ns ±0.324nsperloop (mean ±std.dev.of7runs,10,000,000loopseach)In [13]:timeittime.time()36.7ns ±0.953nsperloop (mean ±std.dev.of7runs,10,000,000loopseach)
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response