Skip to content
Snippets Groups Projects
Commit 8a852c7a authored by Carlos Vega's avatar Carlos Vega
Browse files

moved debug decorator to debug_utils

parent 4cff52c3
No related branches found
No related tags found
1 merge request!171Feature/daily availability
# 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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment