| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-32025: Add time.thread_time()
* Add missing #endif
* Add NEWS blurb
* Add docs and whatsnew
* Address review comments
* Review comments
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add new time functions:
* time.clock_gettime_ns()
* time.clock_settime_ns()
* time.monotonic_ns()
* time.perf_counter_ns()
* time.process_time_ns()
* time.time_ns()
Add new _PyTime functions:
* _PyTime_FromTimespec()
* _PyTime_FromNanosecondsObject()
* _PyTime_FromTimeval()
Other changes:
* Add also os.times() tests to test_os.
* pytime_fromtimeval() and pytime_fromtimeval() now return
_PyTime_MAX or _PyTime_MIN on overflow, rather than undefined
behaviour
* _PyTime_FromNanoseconds() parameter type changes from long long to
_PyTime_t
|
|
|
|
|
|
|
|
|
|
| |
bpo-31803: time.clock() and time.get_clock_info('clock') now emit a
DeprecationWarning warning.
Replace time.clock() with time.perf_counter() in tests and demos.
Remove also hasattr(time, 'monotonic') in test_time since time.monotonic()
is now always available since Python 3.5.
|
|
|
|
| |
small negative value. (#4003)
|
|
|
| |
There just isn't much we can assert in a portable way.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* Fix #26669
* Modify NaN check function and error message
* Fix pytime.c when arg is nan
* fix whitespace
|
|
|
|
|
|
| |
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
|
|
|
|
|
|
|
| |
Based on patch by Victor Stinner.
Add private C API function _PyUnicode_AsUnicode() which is similar to
PyUnicode_AsUnicode(), but checks for null characters.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Overflow test in test_FromSecondsObject() fails on FreeBSD 10.0 buildbot which
uses clang. clang implements more aggressive optimization which gives
different result than GCC on undefined behaviours.
Check if a multiplication will overflow, instead of checking if a
multiplicatin had overflowed, to avoid undefined behaviour.
Add also debug information if the test on overflow fails.
|
|
|
|
| |
Filter also values for check_float_rounding().
|
|
|
|
| |
Filter values which would overflow when converted to a C time_t type.
|
|
|
|
|
|
|
| |
* Filter values which would overflow on conversion to the C long type
(for timeval.tv_sec).
* Adjust also the message of OverflowError on PyTime conversions
* test_time: add debug information if a timestamp conversion fails
|
|
|
|
|
|
|
|
|
|
| |
Drop all hardcoded tests. Instead, reimplement each function in Python, usually
using decimal.Decimal for the rounding mode.
Add much more values to the dataset. Test various timestamp units from
picroseconds to seconds, in integer and float.
Enhance also _PyTime_AsSecondsDouble().
|
|
|
|
|
|
|
|
|
|
|
|
| |
datetime.datetime now round microseconds to nearest with ties going to nearest
even integer (ROUND_HALF_EVEN), as round(float), instead of rounding towards
-Infinity (ROUND_FLOOR).
pytime API: replace _PyTime_ROUND_HALF_UP with _PyTime_ROUND_HALF_EVEN. Fix
also _PyTime_Divide() for negative numbers.
_PyTime_AsTimeval_impl() now reuses _PyTime_Divide() instead of reimplementing
rounding modes.
|
|\ |
|
| | |
|
| | |
|
|\ \ |
|
| |\ \
| | |/
| |/| |
|
|\ \ \
| |/ / |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp().
microseconds sign should be kept before rounding.
|
| | |
| | |
| | |
| | | |
_PyTime_ObjectToTimespec()
|
| | |
| | |
| | |
| | | |
rounding
|
| | | |
|
| | |
| | |
| | |
| | | |
used.
|
|/ / |
|
| | |
|
| |
| |
| |
| |
| | |
Fix also _Py_InitializeEx_Private(): initialize time before initializing
import, import_init() uses the _PyTime API (for thread locks).
|
| |
| |
| |
| |
| |
| | |
_PyTime_AsMicroseconds() rounding.
Add also unit tests.
|
| |
| |
| |
| | |
Use _PyTime_ROUND_FLOOR and _PyTime_ROUND_CEILING instead.
|
| |
| |
| |
| | |
Add also more tests for ROUNd_FLOOR.
|
| |
| |
| |
| |
| |
| | |
- _PyTime_ObjectToTime_t()
- _PyTime_ObjectToTimespec()
- _PyTime_ObjectToTimeval()
|
| |
| |
| |
| |
| | |
module. time.clock_settime() now uses this rounding method instead of
_PyTime_ROUND_DOWN to handle correctly dates before 1970.
|
| |
| |
| |
| |
| |
| |
| | |
* _PyTime_AsTimeval() now ensures that tv_usec is always positive
* _PyTime_AsTimespec() now ensures that tv_nsec is always positive
* _PyTime_AsTimeval() now returns an integer on overflow instead of raising an
exception
|
| |
| |
| |
| |
| | |
* Add _PyTime_AsTimespec()
* Add unit tests for _PyTime_AsTimespec()
|
| |
| |
| |
| |
| |
| | |
* Add _PyTime_FromNanoseconds()
* Add _PyTime_AsSecondsDouble()
* Add unit tests for _PyTime_AsSecondsDouble()
|
|/
|
|
|
|
| |
* Rename _PyTime_FromObject() to _PyTime_FromSecondsObject()
* Add _PyTime_AsNanosecondsObject() and _testcapi.pytime_fromsecondsobject()
* Add unit tests
|
|
|
|
|
|
| |
is used as a sentinel () to detect if -1 is really an error or a valid
timestamp. On AIX, tm_wday is unchanged even on success and so cannot be used
as a sentinel.
|
|
|
|
| |
outsize range [1902; 2037].
|
|
|
|
|
|
| |
aways from zero, instead of rounding towards zero.
It should make test_asyncio more reliable, especially test_timeout_rounding() test.
|
|\ |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| | |
time.get_clock_info('monotonic').resolution == 0.015600099999999999
This is just a workaround pending a real resolution to #20101.
|
|\ \
| |/
| |
| | |
very busy/slow buildbot
|
| |
| |
| |
| | |
busy/slow buildbot
|
|\ \
| |/ |
|