def timer(self, key):
        Stats._check_key(key)  # fail early if it's a bad key.

        def wrapper(fn):
            @wraps(fn)
            def inner(*args, **kwargs):
                with self.stats().timer(key):
                    return fn(*args, **kwargs)
            return inner
        return wrapper
Decorator to report timing for a function.
dataset/ETHPy150Open dropbox/changes/changes/ext/statsreporter.py/StatsReporter.timer