A shoddy knock-off of the Unix time
command.
timer <executable-name> <params>
timer32 <executable-name> <params>
timer
does not use the system path.
Your executable needs to be in the current working folder, or you need to specify the full path.
It will not check your OS’s PATH
system variable.
timer
will automatically add the executable’s file extension in the following order:
-
.COM
-
.EXE
-
.BAT
On Windows, it will not check the PATHEXT
system variable.
The Makefile
generates two DOS executables: timer.exe
and timer32.exe
.
These are 16-bit and 32-bit DOS executables, respecitvely.
For timer32
to work on DOS, you need to have a 32-bit DOS expander such as cwsdpmi.exe
.
This can be placed anywhere in your %PATH%
.
For convenience, cwsdpmi.exe
is included in the DOS release of timer
.
Why might you need the 32-bit version? When DOSBox detects an app using a 32-bit extender, it switches the CPU mode from fixed to dynamic. An app that would normally take 1.5 seconds to run, could instead run at closer to 0.3 seconds. This side-effect means that you could make DOSBox temporarily switch from fixed to dynamic, such as when running a compiler.
I was looking for an equivalent for the time
command in DOS, but I couldn’t find one.
A lot of people told me that I should just use a batch file and run echo %TIME%
at the start end end, but that wouldn’t work on DOSBox because the %TIME%
system variable isn’t implemented.
So, I decided to roll my own.
It’s not pretty and it’s not that clever. It just times an app.