class TimedClass:

    def __init__(self):
        self.x = 13
self.y = 15

def square(self, _x, _y):
    print(_x ** _y)
myTimedClass = TimedClass()
timeit.Timer(myTImedClass.square).timeit()
Python — Timeit внутри класса