Using the time module 1.1 * 1.2 * ... * 10.1 (increase by 0.1) and 1 * 2 * ... * How do I print out the time it takes to perform 100 (increase by 1)?
python time time-module
You can use the timeit module.
In [1]: import timeit
In [2]: timeit.Timer('for i in range(10000):i += i').timeit(1)
Out[2]: 0.000613681999993787
© 2024 OneMinuteCode. All rights reserved.