Most ad-hoc timing code in Python looks like this:
start = time.perf_counter()
result = do_work()
elapsed = time.perf_counter() - start
stats[name].append(elapsed)
It works, until do_work() raises. Then the line that records the timing never runs, the exception propagates, and the one call that was probably slowest — the one that failed — is silently missing from your stats. If you're using timing data to find what's expensive, the failing case is exactly the one you can least afford to lose.
, and on PyPI as pip install timerx. Try decorating a function that raises on every third call and check timerx.get_stats() afterward — the failed calls are all still there.
SOCIAL SHARE CARD GENERATOR