diff --git a/src/test/basics/Number_test.cpp b/src/test/basics/Number_test.cpp index 9e06d6de531..d4867cc9347 100644 --- a/src/test/basics/Number_test.cpp +++ b/src/test/basics/Number_test.cpp @@ -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(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