To me it looks like Andrew had the right answer -- the ps command is 
actually the one giving the unexpected (misleading) answers.  From man ps:

"CPU usage is currently expressed as the percentage of time spent running 
during the entire lifetime of a process. This is not ideal, and it does 
not conform to the standards that ps otherwise conforms to."

It looks to me like htop and top give the same answers, but they both 
differ from ps on the %CPU numbers.  So I think htop's CPU% gives a better 
answer for most purposes than ps's %CPU.

Mike


On Sun, 4 Sep 2016, Andrew Lunn wrote:

> It is worth reading the man page for ps(1) and htop(1).
>
> ps(1) says:
>
>      %cpu        %CPU      cpu utilization of the process in "##.#" format.
>                             Currently, it is the CPU time used divided by the
>                             time the process has been running
>                             (cputime/realtime ratio), expressed as a
>                             percentage.  It will not add up to 100% unless
>                             you are lucky.
>
> and top(1) says:
>
>        1. %CPU  --  CPU Usage
>           The task's share of the elapsed CPU time since the last screen
>           update, expressed as a percentage of total CPU time.
>
>> From ps we can also see that compiz has been running since February,
> i.e. it has a very high real time. Thus cputime/realtime is low.
>
> This suggests something bad has happened 'recently', causing compiz to
> spin, when it normally just sleeps and occasionally does something.
>
>      Andrew
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list
>