Skip to content

Commit

Permalink
Merge pull request #50 from dave3d/TweakTiming
Browse files Browse the repository at this point in the history
Tweak the timing stuff.
  • Loading branch information
dave3d committed Jun 1, 2023
2 parents 03082b9 + 983b160 commit e11a96c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
5 changes: 5 additions & 0 deletions dicom2stl.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
from utils import vtkutils


def roundThousand(x):
y = int(1000.0 * x + 0.5)
return str(float(y) * 0.001)


def elapsedTime(start_time):
dt = time.perf_counter() - start_time
print(" %4.3f seconds", dt)
Expand Down
16 changes: 2 additions & 14 deletions utils/vtkutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,14 @@
import vtk


#
# timing knick knacks
#


def roundThousand(x):
y = int(1000.0 * x + 0.5)
return str(float(y) * 0.001)


def elapsedTime(start_time):
dt = roundThousand(time.perf_counter() - start_time)
print(" ", dt, "seconds")
dt = time.perf_counter() - start_time
print(" %4.3f seconds", dt)


#
# Isosurface extraction
#


def extractSurface(vol, isovalue=0.0):
"""Extract an isosurface from a volume."""
try:
Expand Down

0 comments on commit e11a96c

Please sign in to comment.