Closed OmarIthawi closed 2 years ago
import timeit code_setup = """ from django.conf import settings from figures.sites import import_from_path """ # code snippet whose execution time is to be measured code_to_measure = """ sites_backend_path = settings.ENV_TOKENS['FIGURES'].get('SITES_BACKEND') sites_backend = import_from_path(sites_backend_path) """ print(timeit.timeit(setup=code_setup, stmt=code_to_measure, number=100000))
The time is 0.6985484063625336 for 100k iterations, which is pretty acceptable imo.
0.6985484063625336
The time is
0.6985484063625336
for 100k iterations, which is pretty acceptable imo.