Timing an Operation in a Batch File.


  1. Posts : 400
    Windows 7 Home Premium (Retail) Full version - With SP1
       #1

    Timing an Operation in a Batch File.


    I have a simple batch file to copy using xcopy to place a copy of certain files onto an external usb hard disk. I would like to find a way to time how long it takes to complete the copying. Is there a function or something I can can call at the batch file start and record the system clock time and then call again at the end of the batch file right before a pause statement that will allow me to determine how long the operation ran? I guess I am asking if can build a 'stopwatch' into the batch file.

    Thank you.
      My Computer


  2. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #2

    Try adding this command at the start and end of the BAT file:
    time /t

    See if that gets what you want.
      My Computer


  3. Posts : 400
    Windows 7 Home Premium (Retail) Full version - With SP1
    Thread Starter
       #3

    DavidW7ncus said:
    Try adding this command at the start and end of the BAT file:
    time /t

    See if that gets what you want.
    Thank you David. That will do nicely.
      My Computer


  4. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #4

    You're welcome and glad it worked...
    Thanks for replying back.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 15:56.
Find Us