次の方法で共有


How long did it take that command to run?

When troubleshooting latency issues I've found it helpful to have firm numbers of how long it took for a command to run?  For instance we were looking at an issue where net viewing a server took a long time, but we didn't have firm number of how long it took each time to compare with healthy servers.  What are we going to do watch the clock? 

Internally we use a tool called timer.exe which does what we want, so I went scavenging around the intertubes to try and find a similar tool that would useful externally.  Here it is.  It's an old tool but don't hold that against it.

https://www.microsoft.com/downloads/details.aspx?familyid=913795CD-7026-4143-AE85-1F5E096F9BE0&displaylang=en

Syntax:

C:\localbin>timethis

-----------------------------------
TIMETHIS  :  Command Timing Utility
-----------------------------------

Usage : TIMETHIS "command"

  TimeThis executes the command specified by its arguments, then reports its
  run time in HH:MM:SS.TTT format.  Quotes around the command are required only
  when the command involves redirection via <, >, >>, or |, etc.  Quotes ensure
  that the redirection is applied to the command being timed, rather than the
  TimeThis command itself.

Example:

C:\localbin>timethis net view \\red-dc-03

TimeThis :  Command Line :  net view \\red-dc-03
TimeThis :    Start Time :  Tue Jan 15 16:04:52 2008

There are no entries in the list.

TimeThis :  Command Line :  net view \\red-dc-03
TimeThis :    Start Time :  Tue Jan 15 16:04:52 2008
TimeThis :      End Time :  Tue Jan 15 16:04:56 2008
TimeThis : Elapsed Time : 00:00:03.446