Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
WCrihfield
in reply to: kresh.bell

Here is a simple Stopwatch example.  It uses the System.Diagnostics.Stopwatch Class.  It is often used to gauge elapsed time differences between different versions of the same code/application for efficiency purposes.  Maybe you can use this object to achieve your goal.

Dim oTimer As New Stopwatch
oTimer.Start
'Do some stuff here
Dim i As Long
Dim oCode As Long
'simply gives it something to do a bunch of times for the example
'should only take a few seconds
For i = 1 To 1000000
	oCode = ThisApplication.Locale
Next
oTimer.Stop
'This one is more specific (shows 3 decimal places after seconds)
MsgBox("Elapsed time = " & oTimer.ElapsedMilliseconds / 1000 & " seconds", vbOKOnly, " ")
'or this one doesn't have any decimal places
'MsgBox("Elapsed time = " & oTimer.Elapsed.Seconds & " seconds",vbOKOnly," ") 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE' :thumbs_up:.

If you have time, please... Vote For My IDEAS :light_bulb:and Explore My CONTRIBUTIONS

Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)