home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boston 2
/
boston-2.iso
/
DOS
/
PROGRAM
/
C
/
SLEEP
/
SLEEP.DOC
< prev
next >
Wrap
Text File
|
1993-12-01
|
2KB
|
51 lines
sleep routines
These routines were originally written by Tim Pozar (address later)
and run in Microsoft C v2.0-5.0. I added the msleep routine which a
friend of mine needed, and this documentation, such as it is.
Using sleep:
void sleep(sec)
int sec;
Delays execution by 'sec' seconds. This is done by interrogating the
DOS clock to measure the elapsed time. Accuracy is about 18ms (one clock
tick).
Using msleep:
void msleep(ms)
int ms;
Delays execution by 'ms' miliseconds. Should be called with a delay of
zero before assuming accurate use. This routine uses the DOS clock
routines to establish the number of time through a software timeing loop
needed for a given delay. This allows finer resolution than the hardware
or DOS clock, while retaining independence of the CPU speed. Accuracy is
about 2%. This routine may be effected by resident programs which steal
CPU time.
Inventory:
Provided here is source, object for linking with other programs, and
this file. Compile with TEST defined for a demo. Note that the time
between beeps will be too long by the duration of the bell. This is not
an error in the routine.
bill davidsen 12/7/87
UUCP: davidsen@crdos1.uucp
/or/ {uunet | philabs} !steinmetz!crdos1!davidsen
ARPA: wedu@ge-crd.arpa
Original author:
=======================================================================
| ...sun!hoptoad!\ Tim Pozar |
| >fidogate!pozar Fido: 1:125/406 |
| ...lll-winken!/ PaBell: (415) 788-3904 |
| USNail: KKSF 77 Maiden Lane San Francisco CA 94108 |
=======================================================================