Category : System Diagnostics for your computer
Archive   : STOP200.ZIP
Filename : ELTIME.C

 
Output of file : ELTIME.C contained in archive : STOP200.ZIP
/* eltime.c - use BIOS time-of-day interrupt */

#include
#include

static long STime; /* store time-of-day from last call */

#define TOD_INT 0x1A /* BIOS time-of-day interrupt */

long
ElapsedTime (void) { /* count ticks since last call */
union REGS DReg;

long ElapsedTime, Delta;

DReg.x.ax = 0; /* get time count */
int86(TOD_INT, &DReg, &DReg); /* get current count */

/* assemble 32-bit time-of-day value */

ElapsedTime = (((long) DReg.x.cx) << 16) + (unsigned) DReg.x.dx;
Delta = ElapsedTime - STime;

/* check for new day since last call */

if (((DReg.x.ax & 0xFF) != 0) || (Delta < 0))
Delta = Delta + 0x01800B0L; /* new day - add 1 day in ticks */
STime = ElapsedTime; /* save time-of-day for next call */
return (Delta); /* return as an integer */
}


  3 Responses to “Category : System Diagnostics for your computer
Archive   : STOP200.ZIP
Filename : ELTIME.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/