/usr/share/pyshared/mx/DateTime/mxDateTime/testcmp.py is in python-egenix-mxdatetime 3.2.1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | from mx.DateTime import *
t = now()
print 'Init...'
l = [None] * 10000
for i in range(10000):
l[i] = DateTimeFromAbsDateTime(t.absdate + i,0)
print 'Sorting... plain'
t = now()
for i in range(100):
l.sort()
l.reverse()
d = now() - t
print ' elapsed time:',d
print 'Sorting... with cmp()'
t = now()
for i in range(100):
l.sort(cmp)
l.reverse()
d = now() - t
print ' elapsed time:',d
|