On this page
time.process_time
Prev: time.perf_counter_ns | Up: time | Next: time.process_time_ns
Rel: time.asctime, time.clock_getres, time.clock_gettime, time.clock_gettime_ns
Ref: docs.python.org — time.process_time
Tags: #public #python3 #stdlib #time
Import
import time
from time import process_time
Signature & Overview
time.process_time()
Process time for profiling: sum of the kernel and user-space CPU time.
Usage
import time
c0 = time.process_time()
_ = sum(i * i for i in range(5000))
assert time.process_time() >= c0
Gotchas
- Excludes
time.sleep()and I/O waits: Measures sum of user + system CPU time across the whole process.
REPL Inspect
from time import process_time
help(process_time)
Linked from
Related notes
- tuts/python3/stdlib_module/time/perf_counter_ns Linked here; links to this page; shared tags: #stdlib, #time
- tuts/python3/stdlib_module/time/process_time_ns Linked here; links to this page; shared tags: #stdlib, #time
- tuts/python3/stdlib_module/time/asctime Linked here; shared tags: #stdlib, #time
- tuts/python3/stdlib_module/time/clock_getres Linked here; shared tags: #stdlib, #time
- tuts/python3/stdlib_module/time/clock_gettime Linked here; shared tags: #stdlib, #time
- tuts/python3/stdlib_module/time/clock_gettime_ns Linked here; shared tags: #stdlib, #time
- tuts/python3/stdlib_module/time/time Linked here; shared tags: #stdlib, #time
- tuts/python3/stdlib_module/time links to this page; shared tags: #stdlib
- tuts/c/stdlib/time shared tags: #stdlib, #time
- tuts/c/stdlib/time/asctime shared tags: #stdlib, #time