src/basilisp/util.py
def timed(f: Optional[Callable[[int], None]] = None):
    """Time the execution of code in the with-block, calling the function
    f (if it is given) with the resulting time in nanoseconds."""
    start = time.perf_counter()
    yield
    end = time.perf_counter()
    if f:
        ns = int((end - start) * 1_000_000_000)
        f(ns)
def timed(f: Optional[Callable[[int], None]] = None):
    """Time the execution of code in the with-block, calling the function
    f (if it is given) with the resulting time in nanoseconds."""
    start = time.perf_counter()
    yield
    end = time.perf_counter()
    if f:
        ns = int((end - start) * 1_000_000_000)
        f(ns)
Time the execution of code in the with-block, calling the function
    f (if it is given) with the resulting time in nanoseconds.