diff options
author | Denys Vlasenko | 2018-08-03 18:17:12 +0200 |
---|---|---|
committer | Denys Vlasenko | 2018-08-03 18:17:12 +0200 |
commit | 4c20d9f2b0223874e2b5ac1235d5f33fdd02589b (patch) | |
tree | e533a2de1fe3e146bb1dcd410e7c6ff6b68fa0a6 /include | |
parent | 9b1c8bf89be668a533505e5fb4405bac6eed651c (diff) | |
download | busybox-4c20d9f2b0223874e2b5ac1235d5f33fdd02589b.zip busybox-4c20d9f2b0223874e2b5ac1235d5f33fdd02589b.tar.gz |
extend fractional duration support to "top -d N.N" and "timeout"
function old new delta
parse_duration_str - 168 +168
sleep_for_duration - 157 +157
top_main 885 928 +43
timeout_main 269 312 +43
handle_input 571 614 +43
duration_suffixes - 40 +40
sfx 40 - -40
sleep_main 364 79 -285
------------------------------------------------------------------------------
(add/remove: 4/1 grow/shrink: 3/1 up/down: 494/-325) Total: 169 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 94caba2..7cad12c 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1018,6 +1018,14 @@ int xatoi_positive(const char *numstr) FAST_FUNC; /* Useful for reading port numbers */ uint16_t xatou16(const char *numstr) FAST_FUNC; +#if ENABLE_FLOAT_DURATION +typedef double duration_t; +void sleep_for_duration(duration_t duration) FAST_FUNC; +#else +typedef unsigned duration_t; +#define sleep_for_duration(duration) sleep(duration) +#endif +duration_t parse_duration_str(char *str) FAST_FUNC; /* These parse entries in /etc/passwd and /etc/group. This is desirable * for BusyBox since we want to avoid using the glibc NSS stuff, which |