google / benchmark

A microbenchmark support library
Apache License 2.0
8.93k stars 1.62k forks source link

Fix Python manual timing example #1722

Closed alxbilger closed 1 month ago

alxbilger commented 9 months ago

According to the user guide, when manual timing, it is necessary to explicit it by using the UseManualTime function. Its equivalent in Python is use_manual_time(). This function was not called in the example.

It is possible to verify that the use of this function has an impact on the measure by adding another time.sleep(0.01) at the end of the iteration. There is a x2 difference depending on whether use_manual_time() is used or not.

google-cla[bot] commented 9 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.