1234567891011121314151617 |
- import datetime
- starttime = datetime.datetime.now()
- # long running
- # do something other
- lls = []
- i = 0
- for i in range(300000):
- lls.append(i)
- # if len(lls) > 1000:
- # lls = []
- i = i + 1
- if i > 1000:
- lls = []
- i = 0
- endtime = datetime.datetime.now()
- print((endtime - starttime))
|