Timing commands execution in Windows

Submit command line tools that you find here.
Post Reply
Message
Author
User avatar
__philippe
Posts: 687
Joined: Wed Jun 26, 2013 2:09 am

Timing commands execution in Windows

#1 Post by __philippe »

Yuletide Speaker's Corner soapbox : Forgotten CLI utilities

Ever wanted to find out how long a command or process takes to complete ?
Unix thoughtfully provides the time command just for that purpose

For Windows users, however, no built-in equivalent exists
(unless one wants to delve into PowerShell   Measure-Command intricacies, which we shall hereby refrain from, thanks for asking)...;)

WinXP|Vista|Win7|Win8|Win10 Quick-and-Dirty solution:

Little known ptime (25KB exe) diminutive tool, developed way back when in 2002, courtesy Jem Berkes
http://www.pc-tools.net/files/win32/fre ... ime-10.zip

ptime command [arguments]

Sample ptime output excerpts, timing the "DIR" command (check result at end of drop-down list)

Code: Select all

C:\WINDOWS\system32>ptime dir /X /P

ptime 1.0 for Win32, Freeware 
Copyright(C) 2002, Jem Berkes <jberkes@pc-tools.net>

=== dir /X /P ===
 Volume in drive C is Preload
 Volume Serial Number is 8C01-2CBF

 Directory of C:\WINDOWS\system32

31/12/2018  15:28    <DIR>                       .
31/12/2018  15:28    <DIR>                       ..
11/10/2007  18:50               333              $ncsp$.inf
11/10/2007  19:55             2,424              $winnt$.inf
11/10/2007  18:41    <DIR>                       (null)
...
...
...
06/07/2008  13:06           575,488              xpsshhdr.dll
06/07/2008  13:06         1,676,288              xpssvcs.dll
10/07/2013  09:54    <DIR>          XPSVIE~1     XPSViewer
26/02/2014  02:59            13,312              xp_eos.exe
13/03/2010  02:12    <DIR>                       zh-HK
13/03/2010  02:12    <DIR>                       zh-TW
14/04/2008  01:12           338,432              zipfldr.dll
05/02/2010  00:30         9,252,380              ZJEGHC
            2308 File(s)    637,377,516 bytes
              78 Dir(s)  33,539,342,336 bytes free

Execution time: 1.985 s
Execution timing accuracy claimed to be within 5 msec or better.

User avatar
Midas
Posts: 6722
Joined: Mon Dec 07, 2009 7:09 am
Location: Sol3

Re: Timing commands execution in Windows

#2 Post by Midas »

Nice tip. But please don't hit me... 8)

User avatar
__philippe
Posts: 687
Joined: Wed Jun 26, 2013 2:09 am

Re: Timing commands execution in Windows

#3 Post by __philippe »

Not to worry... :wink:

...far from being construed as an offensive harassment,
the occasional pat-on-the-back is graciously taken as a courteous gesture of appreciation around here... 8)

Post Reply