Files
django-q2/django_q/tests/tasks.py
Ilan Steemers 45e5187126 Updated README
2015-06-18 18:59:31 +02:00

25 lines
428 B
Python

import time
# simple countdown
def countdown(n):
start_time = time.time()
while n > 0:
n -= 1
stop_time = time.time()
return stop_time - start_time
def count_letters(tup):
total = 0
for word in tup:
total += len(word)
return total
def count_letters2(obj):
return count_letters(obj.get_words())
def result(obj):
print('RESULT HOOK {} : {}'.format(obj.name, obj.result))