mirror of https://github.com/xzeldon/htop.git
Good heuristic for processes started in the same second
This commit is contained in:
parent
dc262f4df6
commit
8d0fff2f66
|
@ -581,8 +581,12 @@ int Process_compare(const void* v1, const void* v2) {
|
||||||
return strcmp(p1->comm, p2->comm);
|
return strcmp(p1->comm, p2->comm);
|
||||||
case NLWP:
|
case NLWP:
|
||||||
return (p1->nlwp - p2->nlwp);
|
return (p1->nlwp - p2->nlwp);
|
||||||
case STARTTIME:
|
case STARTTIME: {
|
||||||
return (p1->starttime_ctime - p2->starttime_ctime);
|
if (p1->starttime_ctime == p2->starttime_ctime)
|
||||||
|
return (p1->pid - p2->pid);
|
||||||
|
else
|
||||||
|
return (p1->starttime_ctime - p2->starttime_ctime);
|
||||||
|
}
|
||||||
#ifdef HAVE_OPENVZ
|
#ifdef HAVE_OPENVZ
|
||||||
case CTID:
|
case CTID:
|
||||||
return (p1->ctid - p2->ctid);
|
return (p1->ctid - p2->ctid);
|
||||||
|
|
Loading…
Reference in New Issue