import time


def timed(f):
    """
    Utility decorator that runs a function and records the execution time.

    Functions with this decorator return (original_result, time_elapsed).
    """
    def timed_func(*args, **kwargs):
        start = time.time()
        result = f(*args, **kwargs)
        end = time.time()
        return (result, end - start)
    return timed_func