aboutsummaryrefslogtreecommitdiffstats
path: root/htop.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:16 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:16 +0200
commitc868e3f8d629e1caddff1a51a7d2dd04f49994a3 (patch)
treedee0881088acc628312dcaaff8209184f4a2560b /htop.c
parentd3c9975943df58e293359b87905d19ff1fd52061 (diff)
downloaddebian_htop-c868e3f8d629e1caddff1a51a7d2dd04f49994a3.tar.gz
debian_htop-c868e3f8d629e1caddff1a51a7d2dd04f49994a3.tar.bz2
debian_htop-c868e3f8d629e1caddff1a51a7d2dd04f49994a3.zip
Imported Upstream version 0.5.1upstream/0.5.1
Diffstat (limited to 'htop.c')
-rw-r--r--htop.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/htop.c b/htop.c
index be162f0..a0f431a 100644
--- a/htop.c
+++ b/htop.c
@@ -416,7 +416,18 @@ int main(int argc, char** argv) {
int acc = 0;
bool follow = false;
+
+ struct timeval tv;
+ double time = 0.0;
+ double oldTime = 0.0;
+ bool recalculate;
+
while (!quit) {
+ gettimeofday(&tv, NULL);
+ time = ((double)tv.tv_sec * 10) + ((double)tv.tv_usec / 100000);
+ recalculate = (time - oldTime > CRT_delay);
+ if (recalculate)
+ oldTime = time;
if (doRefresh) {
incSearchIndex = 0;
incSearchBuffer[0] = 0;
@@ -425,7 +436,8 @@ int main(int argc, char** argv) {
int currScrollV = lb->scrollV;
if (follow)
currPid = ProcessList_get(pl, currPos)->pid;
- ProcessList_scan(pl);
+ if (recalculate)
+ ProcessList_scan(pl);
if (refreshTimeout == 0) {
ProcessList_sort(pl);
refreshTimeout = 1;

© 2014-2024 Faster IT GmbH | imprint | privacy policy