import contextlib
import time


@contextlib.contextmanager
def timeit(callback):
    before = time.time()
    yield
    after = time.time()
    callback(after - before)

35dae0d3efccc78931152502609cf68a46029c99
<mask token>

<mask token>


@contextlib.contextmanager
def timeit(callback):
    before = time.time()
    yield
    after = time.time()
    callback(after - before)

import contextlib
import time


@contextlib.contextmanager
def timeit(callback):
    before = time.time()
    yield
    after = time.time()
    callback(after - before)
