from typing import Callable
import time


def timeit(fn: Callable) -> Callable:
    """Decorator to calculate the execution time of a method."""

    def wraper(self, *args, **kwargs):
        t0 = time.time()
        r = fn(self, *args, **kwargs)
        t1 = time.time()
        print(f"[timeit] {fn.__name__}: {(t1-t0)*1000:.2f} ms")
        return r

    return wraper