| Windows 7: Timing an Operation in a Batch File. |
31 May 2012
|
#1 | | Windows 7 Home Premium (Retail) Full version - With SP1 |
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 System Specs |
| System Manufacturer/Model Number Custom Home Brew OS Windows 7 Home Premium (Retail) Full version - With SP1 CPU 2.70 gigahertz AMD Athlon 64 X2 Dual Core Motherboard FOXCONN A7GM-S 2.0 FAB-A Memory 8192 Megabytes Usable Installed Memory Graphics Card ATI Radeon HD 2400 PRO (Microsoft Corporation WDDM 1.1) [D Sound Card High Definition Audio Device (2x) Monitor(s) Displays Samsung SyncMaster [Monitor] (19.1"vis, s/n HVELA10194, Octo Screen Resolution 1024 X 768 Keyboard HID Keyboard Device (logitech) Mouse Microsoft USB Comfort Optical Mouse 3000 (IntelliPoint) Hard Drives INTEL SSDSA2CW120G3 ATA Device [Hard drive] (120.03 GB)
INTEL SSDSA2CW080G3 ATA Device [Hard drive] (80.02 GB) Internet Speed adsl Other Info The above taken with Bel Arc Advisor |
01 Jun 2012
|
#2 | | Win 7 Pro x64 SP1, Win 7 Ult x86 SP1 NC, USA |
Try adding this command at the start and end of the BAT file: time /t
See if that gets what you want. | My System Specs | | Computer type PC/Desktop System Manufacturer/Model Number home built OS Win 7 Pro x64 SP1, Win 7 Ult x86 SP1 CPU AMD Athlon II x4 620 Motherboard Gigabyte GA-MA785G-UD3H Memory 6GB GSkill DDR2 800 Graphics Card AMD 4670 GPU + AMD 4200 IGP Sound Card on board Realtek ALC889A Monitor(s) Displays RCA 40" LCD TV, Insignia 32" LCD TV, HP 15" LCD monitor Screen Resolution 1680 x 1050... Keyboard Gyration wireless, Logitech wireless, Dell USB wired Mouse Gyration wireless, Logitech wireless, V7 USB wired PSU Corsair 500 W Case Rosewill mid tower Cooling CM 90mm Tower Hard Drives OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ... Internet Speed Uverse - 12Mbps D / 1.5Mbps U Antivirus Avast free OR MSE. (+ MBAM Pro). Browser 1-Firefox, 2-IE. (Chrome and Opera for testing) Other Info 2 PCs: Primary: dual-boot, Test: triple-boot.
Mainly HTPC/Gen purpose (no gaming).
Trendnet USB KVM.
LG DVD burner/Blue Ray Player.
Tray system for removable SATA backup drives.
Not currently OCd, under-volted.
I use Hybrid sleep, rarely re-boot or shutdown.
Hauppauge HD-PVR, Avermedia PCIe TV Tuner, Hauppauge PCI TV Tuner. |
01 Jun 2012
|
#3 | | Windows 7 Home Premium (Retail) Full version - With SP1 |

Quote: Originally Posted by DavidW7ncus 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 System Specs | | System Manufacturer/Model Number Custom Home Brew OS Windows 7 Home Premium (Retail) Full version - With SP1 CPU 2.70 gigahertz AMD Athlon 64 X2 Dual Core Motherboard FOXCONN A7GM-S 2.0 FAB-A Memory 8192 Megabytes Usable Installed Memory Graphics Card ATI Radeon HD 2400 PRO (Microsoft Corporation WDDM 1.1) [D Sound Card High Definition Audio Device (2x) Monitor(s) Displays Samsung SyncMaster [Monitor] (19.1"vis, s/n HVELA10194, Octo Screen Resolution 1024 X 768 Keyboard HID Keyboard Device (logitech) Mouse Microsoft USB Comfort Optical Mouse 3000 (IntelliPoint) Hard Drives INTEL SSDSA2CW120G3 ATA Device [Hard drive] (120.03 GB)
INTEL SSDSA2CW080G3 ATA Device [Hard drive] (80.02 GB) Internet Speed adsl Other Info The above taken with Bel Arc Advisor |
01 Jun 2012
|
#4 | | Win 7 Pro x64 SP1, Win 7 Ult x86 SP1 NC, USA |
You're welcome and glad it worked...
Thanks for replying back. | My System Specs | | Computer type PC/Desktop System Manufacturer/Model Number home built OS Win 7 Pro x64 SP1, Win 7 Ult x86 SP1 CPU AMD Athlon II x4 620 Motherboard Gigabyte GA-MA785G-UD3H Memory 6GB GSkill DDR2 800 Graphics Card AMD 4670 GPU + AMD 4200 IGP Sound Card on board Realtek ALC889A Monitor(s) Displays RCA 40" LCD TV, Insignia 32" LCD TV, HP 15" LCD monitor Screen Resolution 1680 x 1050... Keyboard Gyration wireless, Logitech wireless, Dell USB wired Mouse Gyration wireless, Logitech wireless, V7 USB wired PSU Corsair 500 W Case Rosewill mid tower Cooling CM 90mm Tower Hard Drives OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ... Internet Speed Uverse - 12Mbps D / 1.5Mbps U Antivirus Avast free OR MSE. (+ MBAM Pro). Browser 1-Firefox, 2-IE. (Chrome and Opera for testing) Other Info 2 PCs: Primary: dual-boot, Test: triple-boot.
Mainly HTPC/Gen purpose (no gaming).
Trendnet USB KVM.
LG DVD burner/Blue Ray Player.
Tray system for removable SATA backup drives.
Not currently OCd, under-volted.
I use Hybrid sleep, rarely re-boot or shutdown.
Hauppauge HD-PVR, Avermedia PCIe TV Tuner, Hauppauge PCI TV Tuner. Timing an Operation in a Batch File. problems? All times are GMT -5. The time now is 03:40 PM. | |