Author Topic: Stopwatch and calling function  (Read 59 times)

0 Members and 1 Guest are viewing this topic.

samideqlqpart

  • Newt
  • Posts: 35
Stopwatch and calling function
« on: October 26, 2017, 03:07:09 pm »
hello
i found that the call of my sub"armature" is too long

with stopwatch
i got a phenomenal case

sw.Start()
armature(acBlkTblRec, acCurDb, acTrans, New Point3d(origTextX, origTextY, 0))
sw.Stop()
total = sw.ElapsedMilliseconds
Dim ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.WriteMessage(vbLf & "Total Duration: " & Total & "millisecondes")

the total duration is 4823mseconds


but when i execut it inside the function the total duration is  25 msecondes

Public Sub armature(ByRef acBlkTblRec As BlockTableRecord, ByRef acCurDb As Database, ByRef acTrans As Transaction, _
ByVal origTEXT As Point3d)

sw.Start()
-
-
-
-
sw.Stop()
total = sw.ElapsedMilliseconds
Dim ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
ed.WriteMessage(vbLf & "Total Duration: " & total & "millisecondes")
End Sub

what is the problem? what is wrong?
thanks!