Skip to content

Commit

Permalink
Add timer for post processing step
Browse files Browse the repository at this point in the history
The post processing step might take a while to finish. This commit makes
it possible to collect the time of the post processing step.
  • Loading branch information
furti committed Mar 19, 2019
1 parent 67f616a commit 7ebdb79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion base_lithophane_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def run(self):

processingSteps = processor.getProcessingSteps(fp)

numberOfSteps = len(processingSteps)
numberOfSteps = len(processingSteps) + 1
progress_bar.start(processor.description, numberOfSteps)
actualStep = 1
lastReturnValue = None
Expand All @@ -64,7 +64,12 @@ def run(self):
actualStep += 1

if not CANCEL_TASK:
timers.append(Timer('%s (%s/%s)' % ('Post Processing', actualStep, numberOfSteps)))

processor.processingDone(fp, lastReturnValue)

progress_bar.next()
timers[-1].stop()

FreeCAD.Console.PrintMessage('%s took %.3f s' % (processor.description, computeOverallTime(timers)))
except:
Expand Down

0 comments on commit 7ebdb79

Please sign in to comment.