Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As answered here: <a href="https://stackoverflow.com/questions/4487100/how-can-i-use-a-windows-batch-file-to-measure-the-performance-of-console-applica">How can I use a Windows batch file to measure the performance of console application?</a></p> <p>Below batch "program" should do what you want. Please note that it outputs the data in centiseconds instead of milliseconds. The precision of the used commands is only centiseconds.</p> <p>Here is an example output:</p> <pre><code>STARTTIME: 13:42:52,25 ENDTIME: 13:42:56,51 STARTTIME: 4937225 centiseconds ENDTIME: 4937651 centiseconds DURATION: 426 in centiseconds 00:00:04,26 </code></pre> <p>Here is the batch script:</p> <pre><code>@echo off setlocal rem The format of %TIME% is HH:MM:SS,CS for example 23:59:59,99 set STARTTIME=%TIME% rem here begins the command you want to measure dir /s &gt; nul rem here ends the command you want to measure set ENDTIME=%TIME% rem output as time echo STARTTIME: %STARTTIME% echo ENDTIME: %ENDTIME% rem convert STARTTIME and ENDTIME to centiseconds set /A STARTTIME=(1%STARTTIME:~0,2%-100)*360000 + (1%STARTTIME:~3,2%-100)*6000 + (1%STARTTIME:~6,2%-100)*100 + (1%STARTTIME:~9,2%-100) set /A ENDTIME=(1%ENDTIME:~0,2%-100)*360000 + (1%ENDTIME:~3,2%-100)*6000 + (1%ENDTIME:~6,2%-100)*100 + (1%ENDTIME:~9,2%-100) rem calculating the duratyion is easy set /A DURATION=%ENDTIME%-%STARTTIME% rem we might have measured the time inbetween days if %ENDTIME% LSS %STARTTIME% set set /A DURATION=%STARTTIME%-%ENDTIME% rem now break the centiseconds down to hors, minutes, seconds and the remaining centiseconds set /A DURATIONH=%DURATION% / 360000 set /A DURATIONM=(%DURATION% - %DURATIONH%*360000) / 6000 set /A DURATIONS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000) / 100 set /A DURATIONHS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000 - %DURATIONS%*100) rem some formatting if %DURATIONH% LSS 10 set DURATIONH=0%DURATIONH% if %DURATIONM% LSS 10 set DURATIONM=0%DURATIONM% if %DURATIONS% LSS 10 set DURATIONS=0%DURATIONS% if %DURATIONHS% LSS 10 set DURATIONHS=0%DURATIONHS% rem outputing echo STARTTIME: %STARTTIME% centiseconds echo ENDTIME: %ENDTIME% centiseconds echo DURATION: %DURATION% in centiseconds echo %DURATIONH%:%DURATIONM%:%DURATIONS%,%DURATIONHS% endlocal goto :EOF </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload