In some versions of ps
, the %CPU
column shows the average CPU usage over the entire life of the process. Others implement a decaying average (http://www.google.com/search?q=ps+cpu+decaying+average) but even with that you'd have to wait a while after suspending for the average to drop to 0.
POSIX says:
pcpu
The ratio of CPU time used recently to CPU time available in the same period, expressed as a percentage. The meaning of "recently" in this context is unspecified. The CPU time available is determined in an unspecified manner.
And the rationale:
The pcpu field indicates that the CPU time available is determined in an unspecified manner. This is because it is difficult to express an algorithm that is useful across all possible machine architectures. Historical counterparts to this value have attempted to show percentage of use in the recent past, such as the preceding minute. Frequently, these values for all processes did not add up to 100%. Implementations are encouraged to provide data in this field to users that will help them identify processes currently affecting the performance of the system.