Skip to content

Commit

Permalink
h2load: Allow unit in -D option
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Feb 23, 2021
1 parent 276792a commit 92944f7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/h2load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1903,7 +1903,7 @@ void print_help(std::ostream &out) {
length of the period in time. This option is ignored if
the rate option is not used. The default value for this
option is 1s.
-D, --duration=<N>
-D, --duration=<DURATION>
Specifies the main duration for the measurements in case
of timing-based benchmarking. -D and -r are mutually
exclusive.
Expand Down Expand Up @@ -2199,10 +2199,9 @@ int main(int argc, char **argv) {
break;
}
case 'D':
config.duration = strtoul(optarg, nullptr, 10);
if (config.duration == 0) {
std::cerr << "-D: the main duration for timing-based benchmarking "
<< "must be positive." << std::endl;
config.duration = util::parse_duration_with_unit(optarg);
if (!std::isfinite(config.duration)) {
std::cerr << "-D: value error " << optarg << std::endl;
exit(EXIT_FAILURE);
}
break;
Expand Down

0 comments on commit 92944f7

Please sign in to comment.