From 12a1a33e83f42e1ae905993810a0d6e8386d42c5 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Sat, 23 Dec 2023 17:49:30 +0100 Subject: [PATCH] @timeit --- 2023/day16.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/2023/day16.py b/2023/day16.py index 14e50f6..0781470 100755 --- a/2023/day16.py +++ b/2023/day16.py @@ -3,9 +3,8 @@ Jour 16 du défi Advent Of Code pour l'année 2023 """ import os -from functools import cache, wraps from tqdm import tqdm -import time +from aoc_utils.decorators import timeit def read_sample() -> list[str]: """récupère les entrées depuis le fichier texte correspondant""" @@ -16,18 +15,6 @@ def read_sample() -> list[str]: return sample -def timeit(func): - @wraps(func) - def timeit_wrapper(*args, **kwargs): - start_time = time.perf_counter() - result = func(*args, **kwargs) - end_time = time.perf_counter() - total_time = end_time - start_time - print(f'Function {func.__name__} Took {total_time:.4f} seconds') - return result - return timeit_wrapper - - def diff(l1: set, l2: set) -> bool: return len(l1 ^ l2) > 0