home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_02_02
/
ctimer.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-09-29
|
349b
|
21 lines
#include <dos.h>
#define TimerResolution 1193181.667
void cardinal(long l, double *result)
{
*result = ((l < 0) ? (double)4294967296.0 + (long) l : (double)((long) l));
}
void elapsedtime(long start, long stop, double *result)
{
double r;
cardinal(stop - start,&r);
*result = (1000.0 * r) / TimerResolution;
}