- changed status to wontfix
Allow initializing `attotime` objects with arbitrary `nanosecond` number
Issue #2
wontfix
Instead of handling numerical conversions externally, teach the method (e.g. attotime.attotime
) to automatically convert excess units of time to the necessary unit.
e.g. attotime.attotime(nanosecond=time.perf_counter_ns())
should not lead to
...
File "/home/stdedos/.local/lib/python3.8/site-packages/attotime/objects/attotime.py", line 38, in __init__
raise ValueError(
ValueError: nanosecond must be in 0..1000
Comments (2)
-
repo owner -
reporter Eventually, that’s what I wanted to do, yes.
I also wanted, after-the-fact, to “optimize this” to human-readable time, say print
~4,149s
instead
- Log in to comment
I do see the appeal, but the objects are designed to match the Python 3 API so are bounded accordingly.
Perf counters generally shouldn't be used as an absolute time value ("only the difference between the results of two calls is valid"), so a delta might be a good fit for your use, eg.: