I just want to measure the time it takes a program to go from start to finish.

In UNIX - I can use the time command. Is there any way to do this in a MS DOS or FreeDOS?

  • 3
    No, there isn't.
    – harrymc
    Aug 12, 2022 at 20:12

3 Answers 3


There is not. But you can emulate something like with commands:


and calculate the difference between two times

One very sample C program like this can help you:

#include <stdio.h>
#include <time.h>
int main(int argc, char** argv)
time_t a, b;
printf("%d\n", b-a);
  • Many Thanks. Is there perhaps a TSR 3rd party tool that can do this very accurately?
    – Coder
    Aug 12, 2022 at 20:27
  • @Coder, I am not aware of such tool Aug 12, 2022 at 20:31
  • Cygwin doesn't run in pure DOS.
    – Coder
    Aug 12, 2022 at 20:31
  • @Coder, correct. I realize it and remove my comment :) Aug 12, 2022 at 20:32
  • 1
    Thanks. I'm already writing a better version.
    – Coder
    Aug 12, 2022 at 21:00

Use 4DOS shell instead

4DOS is a command interpreter similar to Command, but contains extensions such as the ability to scroll back through previous commands, pop-up help, and other useful features. 4DOS was written by Rex Conn and Tom Rawson, both of JP Software.


It's the most famous alternative shell that's vastly superior to COMMAND.COM and has a TIMER command for your purpose

The TIMER command lets you time events. The following line also shows 4DOS's ability to accept multiple commands on one line, separated by a caret [^]. It starts the timer, runs the TOUR2.BTM file to create the three demonstration files, deletes the three files, and then stops the timer and displays the time the whole operation took. Enter this command to time the entire sequence on your computer:

c:\4dos> timer ^ tour2 ^ del filel file2 file3 ^ timer
Timer 1 on: 11:10:01

Please wait ...

File creation completed
Deleting c:\4dos\file1
Deleting c:\4dos\file2
Deleting c:\4dos\file3
     3 file(s) deleted
Timer 1 off: 11:10:06 elapsed: 0:00:05.11

jpsoftware :: 4DOS Reference Manual
[page 37 - Chapter 3 / A guided tour of 4DOS # Other commands] — Text transcription for easy searching, but slightly incorrect due to OCR
(Alternative link)

In fact 4DOS is the predecessor of Take Command / TCC shell in Windows which also has the TIMER command


I found out that there is a program called RUNTIME.EXE on the FreeDOS 1.3 Bonus CD in the package RUNTIME.ZIP. This allows to measure the time it takes a program to run. It's quite similar to unix's time command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .