Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
htop
Commits
ea191b53
Commit
ea191b53
authored
Apr 25, 2014
by
Hisham Muhammad
Browse files
Fix time-based sorting
parent
eb1cd4ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Process.c
View file @
ea191b53
...
...
@@ -338,7 +338,7 @@ static void Process_humanNumber(RichString* str, unsigned long number, bool colo
largeNumberColor
=
CRT_colors
[
PROCESS
];
processMegabytesColor
=
CRT_colors
[
PROCESS
];
}
if
(
number
>=
(
10
*
ONE_DECIMAL_M
))
{
#ifdef __LP64__
if
(
number
>=
(
100
*
ONE_DECIMAL_G
))
{
...
...
@@ -841,10 +841,10 @@ int Process_compare(const void* v1, const void* v2) {
return
(
p2
->
percent_cpu
>
p1
->
percent_cpu
?
1
:
-
1
);
case
PERCENT_MEM
:
return
(
p2
->
m_resident
-
p1
->
m_resident
);
case
UTIME
:
return
(
p2
->
utime
-
p1
->
utime
)
;
case
STIME
:
return
(
p2
->
stime
-
p
1
->
stime
)
;
case
UTIME
:
diff
=
p2
->
utime
-
p1
->
utime
;
goto
test_diff
;
case
CUTIME
:
diff
=
p2
->
c
utime
-
p1
->
c
utime
;
goto
test_diff
;
case
STIME
:
diff
=
p2
->
stime
-
p1
->
stime
;
goto
test_diff
;
case
CSTIME
:
diff
=
p2
->
c
stime
-
p
2
->
c
stime
;
goto
test_diff
;
case
TIME
:
return
((
p2
->
utime
+
p2
->
stime
)
-
(
p1
->
utime
+
p1
->
stime
));
case
COMM
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment