From 6a55b4e403979ba299261816a7ec1bb55bbf3f2b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 29 Nov 2020 12:40:25 +0100 Subject: libbb: introduce and use msleep() function old new delta msleep - 45 +45 watchdog_main 271 266 -5 common_traceroute_main 3546 3530 -16 beep_main 277 248 -29 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 45/-50) Total: -5 bytes Signed-off-by: Denys Vlasenko --- miscutils/beep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'miscutils/beep.c') diff --git a/miscutils/beep.c b/miscutils/beep.c index 1669332fd..7c60aed08 100644 --- a/miscutils/beep.c +++ b/miscutils/beep.c @@ -114,10 +114,10 @@ int beep_main(int argc, char **argv) while (rep) { //bb_error_msg("rep[%d] freq=%d, length=%d, delay=%d", rep, freq, length, delay); xioctl(speaker, KIOCSOUND, (void*)(uintptr_t)tickrate_div_freq); - usleep(1000 * length); + msleep(length); ioctl(speaker, KIOCSOUND, (void*)0); if (--rep) - usleep(1000 * delay); + msleep(delay); } } -- cgit v1.2.3