diff options
author | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:16 +0200 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2016-04-11 13:00:16 +0200 |
commit | c868e3f8d629e1caddff1a51a7d2dd04f49994a3 (patch) | |
tree | dee0881088acc628312dcaaff8209184f4a2560b /htop.c | |
parent | d3c9975943df58e293359b87905d19ff1fd52061 (diff) | |
download | debian_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.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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; |