import time


def timeme(method):
    """@timeme decorator. Place before any function you want timed.

    Example:
        @timeme
        def print_after_three(s):
            time.sleep(3)
            return s
        print_after_three("testing timeme")
        >> ('print_after_three', 3003, 'ms')
    """
    def wrapper(*args, **kw):
        startTime = int(round(time.time() * 1000))
        result = method(*args, **kw)
        endTime = int(round(time.time() * 1000))

        print(method.__name__, endTime - startTime,'ms')
        return result

    return wrapper