Quote:
> I'm developing a DOS C application that I want to run at the same
> speed no matter what computer it's running on. (I'm willing to let the
> slowest computer be, say, a 386 20-MHz system, so that slower systems
> are not an issue here.) Therefore, I must be able to determine the
> speed of the system so that I can compensate for faster systems by
> applying appropriate delays.
> Can someone direct me to software that detects system speed?
First of all, this is a DOS question so please followup in
comp.os.msdos.programmer. However, here is a pointer or two.
One way to handle this that I have tried is to run a test loop
at the start of your program to test the processor. This works
for DOS programs but of course even DOS programs get run under
Windows these days so don't count on the results being consistent.
Your best bet is to use system timing functions and sleep until
you are due to continue. How you do this will depend on your
specific requirements. I have used a very simple technique that
involves no interrupt hooking. I simply read the value at the
timer location in low memory. Of course this doesn't work if
1/18 sec granularity isn't good enough. It also doesn't release
the processor while you are waiting.
Best is to clarify your requirements and post again. Perhaps
something is mentioned in the FAQ for comp.os.msdos.programmer.
--
http://www.*-*-*.com/ ; | and a sheep voting
on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.