Skip to content

Commit

Permalink
Merge pull request #226 from andreypz/patch-1
Browse files Browse the repository at this point in the history
Replace time.clock() with time.time()
  • Loading branch information
fgolf authored Mar 2, 2020
2 parents 16e8dd4 + 105c7f1 commit f4c0d76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/postprocessing/framework/eventloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def eventLoop(modules, inputFile, outputFile, inputTree, wrappedOutputTree, maxE
for m in modules:
m.beginFile(inputFile, outputFile, inputTree, wrappedOutputTree)

t0 = time.clock(); tlast = t0; doneEvents = 0; acceptedEvents = 0
t0 = time.time(); tlast = t0; doneEvents = 0; acceptedEvents = 0
entries = inputTree.entries
if eventRange: entries = len(eventRange)
if maxEvents > 0: entries = min(entries, maxEvents)
Expand All @@ -67,11 +67,11 @@ def eventLoop(modules, inputFile, outputFile, inputTree, wrappedOutputTree, maxE
wrappedOutputTree.fill()
if progress:
if ie > 0 and ie % progress[0] == 0:
t1 = time.clock()
t1 = time.time()
progress[1].write("Processed %8d/%8d entries, %5.2f%% (elapsed time %7.1fs, curr speed %8.3f kHz, avg speed %8.3f kHz), accepted %8d/%8d events (%5.2f%%)\n" % (
ie,entries, ie/float(0.01*entries), t1-t0, (progress[0]/1000.)/(max(t1-tlast,1e-9)), ie/1000./(max(t1-t0,1e-9)), acceptedEvents, doneEvents, acceptedEvents/(0.01*doneEvents) ))
tlast = t1
for m in modules:
m.endFile(inputFile, outputFile, inputTree, wrappedOutputTree)

return (doneEvents, acceptedEvents, time.clock() - t0)
return (doneEvents, acceptedEvents, time.time() - t0)

0 comments on commit f4c0d76

Please sign in to comment.