Fix Python manual timing example (#1722)

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.

Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
This commit is contained in:
Alex Bilger 2024-08-16 16:32:48 +02:00 committed by GitHub
parent ec3dc37b60
commit 437fea4b54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -61,6 +61,7 @@ def skipped(state):
@benchmark.register
@benchmark.option.use_manual_time()
def manual_timing(state):
while state:
# Manually count Python CPU time