Ticket #32306: test.py

File test.py, 420 bytes (added by David Smith, 4 years ago)
Line 
1from datetime import datetime
2import time
3from django.utils.functional import classproperty
4from functools import lru_cache
5import timeit
6
7
8class TestClass:
9
10 @classproperty
11 @lru_cache
12 def test_property(self):
13 time.sleep(2)
14
15
16def timeit():
17 start = datetime.now()
18 TestClass.test_property
19 end = datetime.now()
20 duration = end - start
21 return duration
22
23print(timeit())
24print(timeit())
25
Back to Top