Thanks everone for helping me answer my question, indeed both time.perf_counter_ns() and timeit work as intended.
time.perf_counter_ns()
timeit