Skip to content

Instantly share code, notes, and snippets.

View clouless's full-sized avatar
🏯
coding

Bernhard Grünewaldt clouless

🏯
coding
View GitHub Profile
@daanzu
daanzu / throttle.py
Last active March 12, 2025 12:09 — forked from ChrisTM/throttle.py
Python decorator for throttling and ramping function calls.
from datetime import datetime, timedelta
from functools import wraps
class throttle(object):
"""
Decorator that prevents a function from being called more than once every
time period.
To create a function that cannot be called more than once a minute: