def isprime_timing ( n ): from sympy import isprime from time import perf_counter tic = perf_counter ( ) # Start the clock. is_prime = isprime ( n ) toc = perf_counter ( ) # Stop the clock. print ( 'isprime(): is ', n, ' prime? ', is_prime ) print ( ' Computing seconds was ', toc - tic )