01-05-2021
10:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-05-2021
10:55 AM
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'
.
If you have time, please... Vote For My IDEAS
and Explore My CONTRIBUTIONS
Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield
(Not an Autodesk Employee)