On 2023-09-15 21:48:37 +0000, rmlibre--- via Python-list wrote: > I'd like to capture the output of `time.perf_counter_ns()` as an 8-byte > timestamp. > > I'm aware that the docs provide an undefined start value for that clock. > I'm going to assume that means it can't be expected to fit within 8 > bytes.
Theoretically this is true. The reference point could be the switch to the Gregorian calendar in the Vatican, the begin of the Christian era or the founding of Babylon, all of which were more than 2**63 seconds ago. However, using one of these dates would be impractical and defeat the purpose of the performance counters, which are supposed to be high resolution, monotonic and independent of political influences. So the reference point is usually the time the system was booted or something similar. > However, it would be rather convenient if it could. Unless you expect your system to have an uptime in excess of 292 years, don't worry. hp -- _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | h...@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"
signature.asc
Description: PGP signature
-- https://mail.python.org/mailman/listinfo/python-list