From 8a852c7a8f2147c1ffdb90fa5fbeb6cc13e7a07c Mon Sep 17 00:00:00 2001 From: Carlos Vega <carlos.vega@uni.lu> Date: Fri, 12 Oct 2018 16:56:02 +0200 Subject: [PATCH] moved debug decorator to debug_utils --- smash/web/utils.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/smash/web/utils.py b/smash/web/utils.py index 6578824e..1bbb74ec 100644 --- a/smash/web/utils.py +++ b/smash/web/utils.py @@ -1,22 +1,8 @@ # coding=utf-8 from django.utils import timezone -import datetime, time +import datetime from datetime import timedelta -def timeit(method): - def timed(*args, **kw): - ts = time.time() - result = method(*args, **kw) - te = time.time() - if 'log_time' in kw: - name = kw.get('log_name', method.__name__.upper()) - kw['log_time'][name] = int((te - ts) * 1000) - else: - print '%r %2.2f ms' % \ - (method.__name__, (te - ts) * 1000) - return result - return timed - def get_today_midnight_date(): today = timezone.now() today_midnight = datetime.datetime(today.year, today.month, today.day, tzinfo=today.tzinfo) -- GitLab