Search notes:

VBScript: measure elapsed time

The following simple script tries to demonstrate how it is possible to measure the elapsed time in VBScript.
option explicit

dim t_start, t_end

t_start = timer

msgBox "Press OK when done"

t_end   = timer

wScript.echo "Elapsed time in seconds: " & formatNumber(t_end - t_start, 1)
Github repository about-VBScript, path: /examples/measure-elapsed-time.vbs
Note: timer returns the number of seconds since the most recent midnight. Thus, if the script ends not on the same day that it is started, the reported number of seconds will be wrong.

Index