Skip to content

Conversation

@encukou
Copy link
Member

@encukou encukou commented Feb 21, 2024

Either the results of these functions are too large, or sysconf(_SC_CLK_TCK) (_Py_GetTicksPerSecond) is too small.

wasi-libc is considering removing process time locks entirely: WebAssembly/wasi-libc#266

This removes them from Python's time early. time.process_time() falls back to clock():

>>> import time
>>> time.time(); time.process_time()
1708512528.3618634
14.538878902
>>> time.time(); time.process_time()
1708512529.045383
15.222434329
>>> time.get_clock_info('process_time')
namespace(implementation='clock()', monotonic=True, adjustable=False, resolution=1e-09)

@encukou encukou merged commit 8aa372e into python:main Feb 22, 2024
@encukou encukou deleted the wasi-no-process-time branch February 22, 2024 11:39
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
…SI (pythonGH-115757)

* pythongh-115714: Don't use CLOCK_PROCESS_CPUTIME_ID and times() on WASI

* Add blurb
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
…SI (pythonGH-115757)

* pythongh-115714: Don't use CLOCK_PROCESS_CPUTIME_ID and times() on WASI

* Add blurb
LukasWoodtli pushed a commit to LukasWoodtli/cpython that referenced this pull request Jan 22, 2025
…SI (pythonGH-115757)

* pythongh-115714: Don't use CLOCK_PROCESS_CPUTIME_ID and times() on WASI

* Add blurb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants