time.process_time() instead of time.clock()
Documentation removed in https://github.com/python/cpython/commit/b6a09ae287e253e4146a5a224b75d4dbfd38cb63
This commit is contained in:
1 parent
7443960053
commit
950d98900d
5 files changed
+12
-12
No files matched your search
+2
-2
@@ -127,7 +127,7 @@ class Panama:
|
||||
## positive for words on left, negative for right.
|
||||
## .stack holds (action, side, arg) tuples
|
||||
update(self, left=[], right=[], best=0, seen={}, diff=0, stack=[],
|
||||
used_reversibles=False, starttime=time.clock(), dict=dict)
|
||||
used_reversibles=False, starttime=time.process_time(), dict=dict)
|
||||
for word in L.split(','):
|
||||
self.add('left', canonical(word))
|
||||
for rword in reversestr(R).split(','):
|
||||
@@ -209,7 +209,7 @@ class Panama:
|
||||
self.best = len(self)
|
||||
self.bestphrase = str(self)
|
||||
print('%5d phrases (%5d words) in %3d seconds' % (
|
||||
self.best, self.bestphrase.count(' ')+1, time.clock() - self.starttime))
|
||||
self.best, self.bestphrase.count(' ')+1, time.process_time() - self.starttime))
|
||||
assert is_panama(self.bestphrase)
|
||||
f = open('pallog%d.txt' % (id(self) % 10000), 'w')
|
||||
f.write(self.bestphrase + '\n')
|
||||
|
||||
Reference in new issue
Block a user