Skip to content

Instantly share code, notes, and snippets.

View SLAPaper's full-sized avatar
🤣
lmao

SLAPaper Pang SLAPaper

🤣
lmao
View GitHub Profile
@SLAPaper
SLAPaper / throttle.py
Last active April 9, 2019 18:22 — forked from ChrisTM/throttle.py
Python decorator for throttling function calls.
# https://gist.github.com/SLAPaper/9ef3699e5f76dc80c00bd2d405eef995
from datetime import datetime, timedelta
from functools import wraps
class throttle:
"""
Decorator that prevents a function from being called more than once every
time period.