diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-04-21 19:37:57 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-04-21 19:37:57 -0300 |
commit | 79e390120ab612ad451bb316cf06370934b0729b (patch) | |
tree | 55a671072ee1f59c438d16602c3370d0627ea12e /htop.c | |
parent | f239b62b9016501a30e1a0f556fe586c6920554f (diff) |
Remove use of usleep, which is sadly obsolete.
Diffstat (limited to 'htop.c')
-rw-r--r-- | htop.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -339,6 +339,16 @@ void sortBy(Panel* panel, ProcessList* pl, Settings* settings, int headerHeight, Object_delete(sortPanel); } +static int millisleep(unsigned long millisec) { + struct timespec req = { + .tv_sec = 0, + .tv_nsec = millisec * 1000000L + }; + while(nanosleep(&req,&req)==-1) { + continue; + } +} + int main(int argc, char** argv) { int delay = -1; @@ -497,7 +507,7 @@ int main(int argc, char** argv) { IncSet* inc = IncSet_new(defaultBar); ProcessList_scan(pl); - usleep(75000); + millisleep(75); FunctionBar_draw(defaultBar, NULL); |