libbb/bb_do_delay.c: shrink
function old new delta difftime 9 - -9 bb_do_delay 88 38 -50 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-59) Total: -59 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
52b971f516
commit
12450dbeef
@ -13,10 +13,9 @@ void FAST_FUNC bb_do_delay(int seconds)
|
|||||||
{
|
{
|
||||||
time_t start, now;
|
time_t start, now;
|
||||||
|
|
||||||
time(&start);
|
start = time(NULL);
|
||||||
now = start;
|
do {
|
||||||
while (difftime(now, start) < seconds) {
|
|
||||||
sleep(seconds);
|
sleep(seconds);
|
||||||
time(&now);
|
now = time(NULL);
|
||||||
}
|
} while ((now - start) < seconds);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user