Solved Timing an Operation in a Batch File.

jsquareg

New member
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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell XPS-8500
OS
Windows 7 Home Premium (Retail) Full version - With SP1
CPU
3.10 Gig Intel Core i5-3350P
Motherboard
Dell 0NW73C A00
Memory
8192 Megabytes Usable Installed Memory
Monitor(s) Displays
Samsung SyncMaster [Monitor] (19.1"vis, s/n HVELA10194, Octo
Screen Resolution
1024 X 768
Hard Drives
INTEL SSDSA2CW120G3 ATA Device [Hard drive] (120.03 GB)
INTEL SSDSA2CW080G3 ATA Device [Hard drive] (80.02 GB)
Keyboard
HID Keyboard Device (HP)
Mouse
Dell (came with computer)
Internet Speed
cox high speed
Other Info
The above taken with Bel Arc Advisor
Try adding this command at the start and end of the BAT file:
time /t

See if that gets what you want.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
home built
OS
Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
CPU
AMD Athlon II x4 620
Motherboard
Gigabyte GA-MA785G-UD3H
Memory
6GB GSkill DDR2 800
Graphics Card(s)
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
Hard Drives
OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ...
PSU
Corsair 500 W
Case
Rosewill mid tower
Cooling
CM 90mm rifle
Keyboard
Gyration wireless, Logitech wireless, Dell USB wired
Mouse
Gyration wireless, Logitech wireless, V7 USB wired
Internet Speed
Spectrum - 100Mbps D / 10Mbps U
Antivirus
Avast, MBAM3, EMET, WinPatrol
Browser
Pale Moon, Firefox, IE
Other Info
2 multi-boot PC's
Mainly HTPC/Office/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.
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

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell XPS-8500
OS
Windows 7 Home Premium (Retail) Full version - With SP1
CPU
3.10 Gig Intel Core i5-3350P
Motherboard
Dell 0NW73C A00
Memory
8192 Megabytes Usable Installed Memory
Monitor(s) Displays
Samsung SyncMaster [Monitor] (19.1"vis, s/n HVELA10194, Octo
Screen Resolution
1024 X 768
Hard Drives
INTEL SSDSA2CW120G3 ATA Device [Hard drive] (120.03 GB)
INTEL SSDSA2CW080G3 ATA Device [Hard drive] (80.02 GB)
Keyboard
HID Keyboard Device (HP)
Mouse
Dell (came with computer)
Internet Speed
cox high speed
Other Info
The above taken with Bel Arc Advisor
You're welcome and glad it worked...
Thanks for replying back.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
home built
OS
Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
CPU
AMD Athlon II x4 620
Motherboard
Gigabyte GA-MA785G-UD3H
Memory
6GB GSkill DDR2 800
Graphics Card(s)
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
Hard Drives
OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ...
PSU
Corsair 500 W
Case
Rosewill mid tower
Cooling
CM 90mm rifle
Keyboard
Gyration wireless, Logitech wireless, Dell USB wired
Mouse
Gyration wireless, Logitech wireless, V7 USB wired
Internet Speed
Spectrum - 100Mbps D / 10Mbps U
Antivirus
Avast, MBAM3, EMET, WinPatrol
Browser
Pale Moon, Firefox, IE
Other Info
2 multi-boot PC's
Mainly HTPC/Office/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.
Back
Top