fem: use time.process_time instead of removed time.clock()
This commit is contained in:
@@ -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)
|
||||
)
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user