Good heuristic for processes started in the same second
diff --git a/Process.c b/Process.c
index e1fbd68..4aae75e 100644
--- a/Process.c
+++ b/Process.c
@@ -581,8 +581,12 @@
return strcmp(p1->comm, p2->comm);
case NLWP:
return (p1->nlwp - p2->nlwp);
- case STARTTIME:
- return (p1->starttime_ctime - p2->starttime_ctime);
+ case STARTTIME: {
+ if (p1->starttime_ctime == p2->starttime_ctime)
+ return (p1->pid - p2->pid);
+ else
+ return (p1->starttime_ctime - p2->starttime_ctime);
+ }
#ifdef HAVE_OPENVZ
case CTID:
return (p1->ctid - p2->ctid);