mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-19 10:58:06 +08:00
25 lines
428 B
Python
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))
|
|
|
|
|