summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.rst21
-rw-r--r--docs/index.rst6
-rw-r--r--psutil/__init__.py1
3 files changed, 8 insertions, 20 deletions
diff --git a/README.rst b/README.rst
index a789d182..3e41d4a9 100644
--- a/README.rst
+++ b/README.rst
@@ -299,9 +299,9 @@ Process management
>>> p
psutil.Process(pid=7055, name='python3', status='running', started='09:04:44')
>>> p.name()
- 'python'
+ 'python3'
>>> p.exe()
- '/usr/bin/python'
+ '/usr/bin/python3'
>>> p.cwd()
'/home/giampaolo'
>>> p.cmdline()
@@ -444,23 +444,6 @@ Further process APIs
>>> gone, alive = psutil.wait_procs(procs_list, timeout=3, callback=on_terminate)
>>>
-Popen wrapper:
-
-.. code-block:: python
-
- >>> import psutil
- >>> from subprocess import PIPE
- >>> p = psutil.Popen(["/usr/bin/python", "-c", "print('hello')"], stdout=PIPE)
- >>> p.name()
- 'python'
- >>> p.username()
- 'giampaolo'
- >>> p.communicate()
- ('hello\n', None)
- >>> p.wait(timeout=2)
- 0
- >>>
-
Windows services
----------------
diff --git a/docs/index.rst b/docs/index.rst
index 079b313c..a884ec80 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -144,6 +144,12 @@ CPU
.. versionchanged:: 4.1.0 added *interrupt* and *dpc* fields on Windows.
+ .. warning::
+ CPU times are always supposed to increase over time, or at least remain
+ the same, and that's because time cannot go backwards.
+ Surprisingly sometimes this might not be the case (at least on Windows
+ and Linux), see `#1210 <https://github.com/giampaolo/psutil/issues/1210#issuecomment-363046156>`__.
+
.. function:: cpu_percent(interval=None, percpu=False)
Return a float representing the current system-wide CPU utilization as a
diff --git a/psutil/__init__.py b/psutil/__init__.py
index 7dac47d5..0b5dff55 100644
--- a/psutil/__init__.py
+++ b/psutil/__init__.py
@@ -1724,7 +1724,6 @@ def cpu_percent(interval=None, percpu=False):
def calculate(t1, t2):
times_delta = _cpu_times_deltas(t1, t2)
-
all_delta = _cpu_tot_time(times_delta)
busy_delta = _cpu_busy_time(times_delta)