Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/test/basics/Number_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1583,6 +1583,30 @@ class Number_test : public beast::unit_test::suite
}
};

class NumberPerf_test : public Number_test
{
void
run() override
{
// This suite will give the most accurate results when run
// single threaded, suppressing non-log output.
// "--unittest=NumberPerf --quiet --unittest-log"
using clock_type = std::chrono::steady_clock;

int limit = 100000;
auto const start = clock_type::now();
for (int i = 0; i < limit; ++i)
{
Number_test::run();
}
auto const duration =
std::chrono::duration_cast<std::chrono::milliseconds>(clock_type::now() - start);

log << "Number test repeated " << limit << " times took " << duration << "\n";
}
};

BEAST_DEFINE_TESTSUITE(Number, basics, xrpl);
BEAST_DEFINE_TESTSUITE_MANUAL(NumberPerf, tx, xrpl);

} // namespace xrpl
Loading