def time_func(func, *args, **kw):
    """ Run the supplied function and arguments.
      Return a the elapsed time in seconds and the function's own return value.
  """
    from cs.logutils import LogTime
    with LogTime(repr(func)) as L:
        ret = func(*args, **kw)
    return L.elapsed, ret
