komanawa.basgra_nz_py.computational_resourse_use.check_resource_use#

Author: Matt Hanson Created: 23/11/2020 9:50 AM

Functions#

timeit_test(py_file_path[, function_names, n])

run an automated timeit test, must be outside of the function definition, prints results in scientific notation units are seconds

Module Contents#

timeit_test(py_file_path, function_names=('test_function', 'test_function2'), n=10)[source]#

run an automated timeit test, must be outside of the function definition, prints results in scientific notation units are seconds

Parameters:
  • py_file_path – path to the python file that holds the functions, if the functions are in the same script as call then __file__ is sufficient. in this case the function call should be protected by: if __name__ == ‘__main__’:

  • function_names – the names of the functions to test (iterable), functions must not have arguments

  • n – number of times to test

Returns: