www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/05/15:34:39

Xref: news2.mv.net comp.os.msdos.djgpp:4624
From: riggscl AT one DOT net (blah)
Newsgroups: comp.os.msdos.djgpp
Subject: Why doesnt this work!
Date: 6 Jun 1996 01:23:00 GMT
Organization: Gwar fan club!
Lines: 31
Message-ID: <4p5btk$5ic@news.cybermax.net>
NNTP-Posting-Host: ln027.cybermax.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Can anyone tell me why this code doesnt work in djgpp.


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

int main(void)
{
   clock_t start, end;
   start = clock();

   delay(2000);

   end = clock();
   printf("The time was: %f\n", (end - start) / CLK_TCK);

   return 0;
}

When i run this after compiling in gcc it always prints 0.00000!
I compiled it with  ->   gcc timer.c -otimer.exe
When i compile in borland c 3.1 or microsoft c 1.0 it works fine and give the 
expected result(some floating point number - about 2.?????)

any ideas?

Chris Riggs
riggscl AT one DOT net


- Raw text -


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