Skip to content

Commit

Permalink
Fix speed tool timeout flag
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Jan 4, 2024
1 parent 4d81067 commit 0268b8c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tool/speed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2570,11 +2570,23 @@ bool Speed(const std::vector<std::string> &args) {
}

if (args_map.count("-timeout") != 0) {
g_timeout_ms = atoi(args_map["-timeout"].c_str()) * 1000;
int timeout = atoi(args_map["-timeout"].c_str());
if (1 > timeout) {
puts("'-timeout' must be positive");
PrintUsage(kArguments);
return false;
}
g_timeout_ms = ((uint64_t)timeout) * 1000;
}

if (args_map.count("-timeout_ms") != 0) {
g_timeout_ms = atoi(args_map["-timeout"].c_str());
int timeout_ms = atoi(args_map["-timeout_ms"].c_str());
if (1 > timeout_ms) {
puts("'-timeout_ms' must be positive");
PrintUsage(kArguments);
return false;
}
g_timeout_ms = timeout_ms;
}

if (args_map.count("-chunks") != 0) {
Expand Down

0 comments on commit 0268b8c

Please sign in to comment.