delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/16/01:04:15

From: Mark Slagell <sluggo AT ames DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Why can't I get rawclock() to work?
Date: Thu, 15 May 1997 22:23:08 -0500
Organization: dept. of redundancy dept.
Lines: 23
Message-ID: <337BD31C.2838@ames.net>
NNTP-Posting-Host: dial50.ppp.iastate.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

It's no big deal, the following code shows the workaround I'm using, but
I still don't know why rawclock() always returns zero.  What am I doing
wrong?


-------------------


#include <stdio.h>
#include <time.h>
#include <dpmi.h>

main() {
__dpmi_regs r;
unsigned long t;

  printf("rawclock(): %d\n",rawclock() );  // Always returns 0; why?

  r.x.ax = 0;
  __dpmi_int( 0x1a, &r );
  t = r.x.cx << 16 | r.x.dx;
  printf("ticks via BIOS: %d\n", t );      // This works fine
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019