Skip to content

Commit 02cdea5

Browse files
committed
clang-tidy
1 parent a8c6aff commit 02cdea5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/host/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,11 +997,13 @@ int main(int argc, char** argv) // NOLINT(bugprone-exception-escape)
997997
// callbacks to be despatched, so as to avoid memory being
998998
// leaked by handles. Capped out of abundance of caution.
999999
constexpr size_t max_iterations = 1000;
1000+
constexpr size_t max_delay_us = 1'000'000; // 1 second
10001001
size_t close_iterations = max_iterations;
10011002
while ((uv_loop_alive(uv_default_loop()) != 0) && (close_iterations > 0))
10021003
{
10031004
uv_run(uv_default_loop(), UV_RUN_NOWAIT);
1004-
usleep(1000); // 1ms
1005+
constexpr size_t per_iteration_sleep_length = max_delay_us / max_iterations;
1006+
usleep(per_iteration_sleep_length);
10051007
close_iterations--;
10061008
}
10071009
LOG_INFO_FMT(

0 commit comments

Comments
 (0)