WinOS – Timing Application Runs

Background

I was recently looking at getting an accurate measure of how long it takes an application to run.

Tools

Here are some tools that work well in the MS Windows environment:-

Outline

  1. time-windows
    • time-windows
  2. Gammadyne Corp
    • timer

Artifacts

  1. time-windows
    • Profile
      • This is a Windows utility which executes a program and displays its execution time, memory usage, and IO statistics. It is similar in functionality to the Unix time utility.
    • Artifacts
      • Google Code Archive
  2. Gammadyne Corp
    • timer
      • Profile
        • TIMER.EXE is used to measure the length of time that other command line operations take to finish. When executed with no parameters, the timer is started. If the “/s” switch is specified, the elapsed time is output to the console.
      • Documentation
        Link
      • Artifacts
        • Gammadyne Corp

InDepth

time-windows

Syntax


TimeMem-1.0 [appName] [command-line-arguments]

Sample


if not exist data mkdir data

TimeMem-1.0 sqlcmd -S localhost -i dbo.usp_get_sales.sql -o data\dbo.sales.txt 

Output

Output – Image

timemem.01.20200521.0939PM

Output – Text


>..\\TimeMem-1.0 sqlcmd -S hrdb -i ..\dbo.usp_get_sales.sql -o data\dbo.sales.txt
Exit code      : 0
Elapsed time   : 6.71
Kernel time    : 0.13 (1.9%)
User time      : 0.30 (4.4%)
page fault #   : 12945
Working set    : 13416 KB
Paged pool     : 201 KB
Non-paged pool : 23 KB
Page file size : 4756 KB

Explanation

  1. Exit Code
    • Sample
      • 0 => Success
  2. Elapsed time
    • Sample
      • 23.65 => time taken is 23 seconds
  3. Kernel time
    • Sample
      • 0.09 (0.4%) => 0.09 seconds
  4. User time
    • Sample
      • 0.31 (1.3%) => 0.31 seconds
  5. Page Fault
    • Sample
      • 0.31 (1.3%) => 0.31 seconds
  6. Working Set
    • Sample
      • 13412 KB => 13 MB
  7. Paged Pool
    • Sample
      • 201 KB => 0.2 MB
  8. Non-Paged Pool
    • Sample
      • 23 KB => 0.02 MB
  9. Page file size
    • Sample
      • 4792 KB => 4.8 MB

 

gammadyne

timer

Syntax


timer.exe

rem initiate application

timer.exe /s

Sample


setlocal

set _bin=timer.exe
set _folderBin=C:\downloads\gammadyne.com\timer
set _folderDBOutput=data

set _dbServer=HRDB

if not exist %_folderDBOutput% mkdir %_folderDBOutput%

%_folderBin%\%_bin% /nologo

sqlcmd -S %_dbServer% -i ..\dbo.usp_get_sales.sql -o %_folderDBOutput%\dbo.sales.txt

%_folderBin%\%_bin% /s /nologo

endlocal

Output

Output – Image

gammadyne.timer.01.20200521.1049PM

Output – Text

>C:\downloads\gammadyne.com\timer\timer.exe /nologo
Timer started: 5/21/2020 10:45:16 p.m.

>sqlcmd -S hrdb -i ..\dbo.usp_get_sales.sql -o data\dbo.sales.txt

>C:\downloads\gammadyne.com\timer\timer.exe /s /nologo
8.4 seconds

References

Here are referenced work:-

  1. Raymond from Malaysia
    • Raymond.cc
      • 7 Ways to Measure Time Taken to Complete a Batch File or Command Line Execution
        Link

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s