The ability to write batch commands will greatly help a computer user to automate simple tasks without the need to learn a programming language to write a dedicated program for it or to even install the bulky development software such as Microsoft Visual Studio. All you need to do is launch Notepad and start writing the commands, then saving it with a .bat extension where Windows operating system will automatically recognize that it is a batch file.
What is the formula to calculate the time it takes to download a file? If you have for example 200mb of a file you download, and your download speed is 140kb/s. How long does it take to download? How do you calculate how long will take to download a 1GB file over 4.5 mbps speed connection? There are 1000 mbs in 1 gb and downloading at a speed of 4.5 mbps all you would need is division.
Running the .bat file will instantly trigger to run the multiple commands in order but sometimes certain commands can fail when they are run too closely to each other. A simple solution is to measure the approximate amount of time taken to completely execute a command, specifying a delay in between and continuing with the next line.
Apart from that, getting an execution time for a command line can also be used for benchmarking purposes. Some examples are measuring the time taken to copy files between computers, or hard drives. Here we have 7 different methods that you can use to track the execution time of a command.
1. ptime
ptime is a small and free tool that was released back in 2002 but still works perfectly in Windows 8.1. Using ptime to measure the amount of time to finish executing a command is as easy as adding the command after the filename. The example command below will measure the amount of time taken to list all files and folders from C: drive.
ptime.exe dir C: /s
ptime claims that the measured execution time is accurate to 5 millisecond or better.
Download ptime
2. TimeThis
TimeThis is an official Microsoft tool from the Windows 2000 Resource Kit. TimeThis is a very old program released back in year 2000 but still works fine in Windows 8.1. The TimeThis.exe executable file is installed in C:Program FilesResource Kit and the installer doesnât set a path that allows the TimeThis.exe tool to be ran anywhere so make sure you change to the Resource Kit directory to run TimeThis.
The usage of TimeThis is exactly the same as ptime. Simply append the command after timethis to measure the time to run the command.
Download TimeThis
3. Gammadyne Timer
The usage of Gammadyne Timer is slightly different than the first two tool mentioned above. It functions as a timer whereby calling the program the first time will start the timer and running it again with a /s switch will stop timer and report the measured elapsed time. Below is an example of a batch file using Gammadyne Timer to count the amount of time taken to complete executing the io.exe test file.
timer.exe
io.exe timer.exe /s
Gammadyne Timer only shows up to decisecond while ptime and timethis shows up to milliseconds.
Download Gammadyne Timer
4. TimeMem
TimeMem is a much newer application that is ported from the Unix time utility. Instead of just showing the total time of executing a command, it also provides other information pertaining to memory usage and IO statistics such as exit code, kernel time, user time, page fault, working set, paged pool, non-paged pool and page file size.
TimeMem requires msvcr100.dll, a Microsoft C runtime library file in order to run or else it would show an error popup saying âThe program canât start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problemâ. If you do not have the file, you can download from here and place it at the same location as TimeMem.
Download TimeMem
5. PowerShell
PowerShell is a more advanced command line shell that you can find built-in to Windows starting from 7 so there is no need to use any third party tool to measure the time to execute a command. A cmdlet Measure-Command can be used to measure the time it takes to run a command.
Measure-Command { .io.exe }
Do take note that it is important to wrap the command that you want to measure with left and right curly brackets or else youâll get an invalid argument error.
6. Ultra Precision Command Timer
Ultra Precision Command Timer is the oldest tool in this category that you can find dated back to 1993 and was created to measure execution time of DOS commands. Running it on Windows 8.1 will prompt you to install a legacy component NTVDM because this tool is a 16-bit application but it still works, but not on 64-bit operating system.
Calculate How Long It Will Take To Download A Files
Youâd be surprised that this old tool is the only one that can measure up to microseconds!
Download Ultra Precision Command Timer
7. %TIME%
Some people would have forgotten that you can actually print the current time and date in command line or DOS with %TIME% and %DATE%. This method would work quite similarly to Gammadyne Timer by printing the current time before and after running the command and save the time to an external timer.txt file.
ECHO Start Measure %Time% >> timer.txt
YOUR COMMAND ECHO Stop Measure %Time% >> timer.txt
The only problem is you have to manually calculate the time differences between the two from the timer.txt file to get the total time to execute the command.
You might also like:5 Ways to Trigger UAC Elevation from Command LineFind Out the Command Line Location When Windows Opens a ProcessFind Hidden Command Line Silent Switches for Setup Files7 Command Line Utilities to Easily Send Email Using SMTP9 Ways To Run Batch Files Silently And Hide The Console Window![]()
Links are offline.
Reply
HAL9000 Admin6 months ago
I checked and two are dead, thanks for the report.
Reply
The TimeThis link is dead. Please update it to the link below, or find the exe inside of it. Reply
web.archive.org/web/20031218225021/http://download.microsoft.com:80/download/win2000platform/timethis/1.00.0.1/NT5/EN-US/timethis_setup.exe
Michael1 year ago
What about some utility that shows elapsed time or progress time until the program is done executing? Not just the time it took.
Michael
Reply
They will be rare because many scripts or tools will scroll the display or the timer data will be mixed in with running commands, it would all get pretty messy.
If you are desperate to see progress just use a GUI based stopwatch and start/stop it manually. Most people donât sit and stare at their screen while running batch scripts so there probably isnât a great demand for what you are looking for.
Reply
Stan4 hours ago
Oh yeaa, I got one. I schedule backing up robots in our plant with a system of scripts. My problem is that some times the 3rd party FTP utility hangs because a robot did not reply. Maybe a cable got cut, or some times it just does not go to end of task as it should and allow the scripts to continue. I want to check to see if the task has been executing too long and if so add a message in the log file, terminate the ftp utility which will allow the script to continue to the next robot. Maybe even kick of an email to the administrator.
Reply
Thanks! Reply
Just the information I needed!
norman9 years ago
nice tool. thanks ray
Reply
I love it! Reply
Now we can talk in factsâ¦
Sandeep Jopat9 years ago
Hi Raymond, Reply
Seems like good utilities, Thanks for the article.
Very good!Thanks!
Reply
Leave a ReplyMove Large Files Fast with Signiant
File transfer with Signiant is the easiest and most secure way to transfer large files fast from anywhere around the world. Test our file transfer calculator above, and you will see how fast file transfer can be regardless of your file size or how far it has to go.
Your Bandwidth Utilization
As file size and complexity continues to grow, latency issues with FTP will become increasingly problematic. FTPâs reliance on TCP cuts its bandwidth use to a fraction of what is available, regardless of your Internet service provider. Signiant provides a smart FTP replacement option; it is designed to practically eliminate latency, and to both optimize and manage your bandwidth use for fast file transfers.
Understand File Transfer AccelerationCalculate How Long It Will Take To Download A File From Github
Signiantâs proprietary acceleration protocol uses enhanced UDP to dramatically improve Internet transmission speeds. Signiantâs file transfer solutions are accessible through the cloud or as an on-premises software solution for fast file sharing anywhere around the world at any time. Test the results of our File Transfer Calculator now.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |