Skip to content

Instantly share code, notes, and snippets.

View rcarlier's full-sized avatar

Richard Carlier rcarlier

View GitHub Profile
@rcarlier
rcarlier / example.py
Created May 3, 2025 04:58
python decorator to measure the execution time of a function
import time
from functools import wraps
def timer(func):
@wraps(func)
def wrapper(*args, **kwargs):
if not hasattr(wrapper, 'total_time'):
wrapper.total_time = 0
_start = time.perf_counter()
/*
O Captain! My Captain!
J'ai demandé à Chat GPT
Comment en JavaScript affiche tous les éléments d'un tableau nommé
"captains" de plusieurs façons différentes ?
De temps en temps, j'ai demandé
Donne m'en d'autre