From f2c8aa6676ebedc34b2cd5089ce6f13c16db1277 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 12 Jan 2010 12:52:30 +0100 Subject: libbb: introduce and use monotonic_ms function old new delta monotonic_ms - 60 +60 process_stdin 433 443 +10 display_speed 85 90 +5 nmeter_main 672 674 +2 builtin_type 114 116 +2 bb__parsespent 117 119 +2 ifplugd_main 1110 1109 -1 acpid_main 441 440 -1 chat_main 1361 1359 -2 doCommands 2458 2449 -9 arpping 466 450 -16 run_command 268 234 -34 readcmd 1072 1034 -38 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 5/7 up/down: 81/-101) Total: -20 bytes Signed-off-by: Denys Vlasenko --- shell/ash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index b47f0e881..e668f41e1 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -12619,7 +12619,7 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) backslash = 0; #if ENABLE_ASH_READ_TIMEOUT if (timeout) /* NB: ensuring end_ms is nonzero */ - end_ms = ((unsigned)(monotonic_us() / 1000) + timeout) | 1; + end_ms = ((unsigned)monotonic_ms() + timeout) | 1; #endif STARTSTACKSTR(p); do { @@ -12630,7 +12630,7 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM) struct pollfd pfd[1]; pfd[0].fd = fd; pfd[0].events = POLLIN; - timeout = end_ms - (unsigned)(monotonic_us() / 1000); + timeout = end_ms - (unsigned)monotonic_ms(); if ((int)timeout <= 0 /* already late? */ || safe_poll(pfd, 1, timeout) != 1 /* no? wait... */ ) { /* timed out! */ -- cgit v1.2.3-55-g6feb