Simple but precise macro timer code that allows you to speed test any macro or part of a macro and then record the results so that you can compare them and tweak your macros to run faster and better.
The code that I show you here is simple, fast, and easy to use, you just copy/paste it where you need it and comment it out when you are finished or remove it.
The snippets provided below are explained in detail in the video above.
Paste this into your macro where the timer should begin.
' Timer Start
' https://www.TeachExcel.com
' - Type Ctrl + G to see the Immediate Window, where the result of this
' will be output. (View > Immediate Window)
Dim timerStart As Double
timerStart = Timer
Paste this into your macro where the timer should end and the output generated.
This outputs to the Immediate Window (Ctrl + G | View > Immediate Window)
' Timer End
' https://www.TeachExcel.com
Debug.Print vbNewLine & String(40, "*") & vbNewLine & _
"Timer: " & Timer - timerStart & _
vbNewLine & String(40, "*") & vbNewLine