It has been many years since I did much C programming but I Have Been Given the job of adding some capabilities to an existing program. I am using the “XP Mode” in Windows 7. The program was written in Borland C++ version 4.52 using the 16 bit 80186 instruction set. The source code is 404 pages long when pasted into word.
The existing program uses the void sleep(unsigned seconds); in many different places but I want to delay the program for a fraction of a second. I have found recommendations to use
After adding this the program contains:Code:#include <windows.h> Sleep(500);
When I do this I get:Code:#include <windows.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <setjmp.h> #include <dos.h> #include <alloc.h> #include <mem.h> #include <time.h> #include <tcp.h> #include <conio.h> Lots of code Sleep(500);
Warning COMMS2.C 423: Call to function 'Sleep' with no prototype in function DownloadAFile
Linker Error: Undefined symbol _Sleep in module COMMS2.C
Another recommendation I found was to use
To get 0.5 second delay. When I did this I didn't get any warnings or errors but my program just stopped. (I didn't wait 500 seconds).Code:delay(500);
I will be grateful to anyone who can help me get a fractional second delay.