There are some older threads (2016ish) here with good advice on how to add a macro duration calculation to your macros. I wanted one to use for my URL cleaner to test a few different approaches and find the fastest solution. I got tired of adding the start time, stop time, and display results actions to the macro in various spots, so I came up with a single macro subroutine to do the work.
To use, add an Execute Macro action where you want the timer to start. Set it to execute the s-theTimer macro, then use the gear icon to set enable both With Parameter and Asynchronously. In the parameter box, type start. Once set up, copy the action.
Next, move to the spot where you want to stop (thanks @rcraighead!) the timer, and paste. Uncheck the Parameter box, and you're done. The timer will start and stop and display the results (in a "brief text" window by default).
I was a bit worried about overhead from calling another macro, so I wrote a simple test case: start timer, delay 1.5 seconds, end timer. I ran this multiple times, and the results were always within portions of a portion of a second of one another—in this case, in fact, the called macro was faster:
Timer in macro: 1.502084
Timer called: 1.501924
At the thousandths level, honestly, I don't even care. I like that I can now easily add a timer to any macro by just calling one macro twice.
Macro is attached, disabled. Enable and test, and let me know how it works for you.
s-theTimer.kmmacros.zip (11.8 KB)