HOME
Stephen Knight
08/23/2012 08:20 PM
Time taken for batch file to execute

Type:

VBScript, Batch/Command file

Category:

Batch, Uptime, VBScript, Time
This script uses a small vbscript line to time a batch file. You can Start / Stop the timer and count how many secs, mins, hours between the two times - they can be on different days if needed and span midnight as it records date & time.

Another option is to use

If you replace the subroutines section with this it will make the date and time within a VBScript. Swap the words day( and month( to get it in mm/dd/yyyy format instead.

Show details for Alternate subroutines to get date using VBScript as otherwise it is dependent on system date format in %date%Alternate subroutines to get date using VBScript as otherwise it is dependent on system date format in %date%
Show details for Alternative Start and End subroutines for date format including the day name:Alternative Start and End subroutines for date format including the day name:


Show details for CodeCode
Hide details for ExplanationExplanation
Hide details for ExamplesExamples
This is the output from the above batch file:

START at 23/08/2012 21:23:45
Waiting
END at 23/08/2012 21:23:48
TIME TAKEN: 3 s
START at 23/08/2012 21:23:48
Waiting
END at 23/08/2012 21:24:33
TIME TAKEN: 45 s
Continuing
END at 23/08/2012 21:26:03
TIME TAKEN: 3 m



Show details for AttachmentsAttachments