fem: use time.process_time instead of removed time.clock()

This commit is contained in:
looooo
2020-01-14 13:45:35 +01:00
committed by Bernd Hahnebach
parent a6ef39b2ec
commit 60ca94d7c2
3 changed files with 6 additions and 6 deletions

View File

@@ -92,7 +92,7 @@ def femmesh_2_mesh(myFemMesh, myResults=None):
# This code generates a dict and a faceCode for each face of all elements
# All faceCodes are than sorted.
start_time = time.clock()
start_time = time.process_time()
faceCodeList = []
faceCodeDict = {}
@@ -196,7 +196,7 @@ def femmesh_2_mesh(myFemMesh, myResults=None):
output_mesh.extend(triangle)
# print("my 2. triangle: ", triangle)
end_time = time.clock()
end_time = time.process_time()
FreeCAD.Console.PrintMessage(
"Mesh by surface search method: {}\n".format(end_time - start_time)
)

View File

@@ -97,7 +97,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
)
def write_calculix_input_file(self):
timestart = time.clock()
timestart = time.process_time()
FreeCAD.Console.PrintMessage("Start writing CalculiX input file\n")
FreeCAD.Console.PrintMessage("Write ccx input file to: {}\n".format(self.file_name))
FreeCAD.Console.PrintLog(
@@ -115,7 +115,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
self.write_calculix_one_input_file()
writing_time_string = (
"Writing time CalculiX input file: {} seconds"
.format(round((time.clock() - timestart), 2))
.format(round((time.process_time() - timestart), 2))
)
if self.femelement_count_test is True:
FreeCAD.Console.PrintMessage(writing_time_string + " \n\n")

View File

@@ -92,7 +92,7 @@ class FemInputWriterZ88(FemInputWriter.FemInputWriter):
)
def write_z88_input(self):
timestart = time.clock()
timestart = time.process_time()
if not self.femnodes_mesh:
self.femnodes_mesh = self.femmesh.Nodes
if not self.femelement_table:
@@ -109,7 +109,7 @@ class FemInputWriterZ88(FemInputWriter.FemInputWriter):
self.write_z88_solver_parameter()
writing_time_string = (
"Writing time input file: {} seconds"
.format(round((time.clock() - timestart), 2))
.format(round((time.process_time() - timestart), 2))
)
FreeCAD.Console.PrintMessage(writing_time_string + " \n\n")
return self.dir_name