delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/16/04:26:37

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3B0239E3.947D80F4@gatwick.geco-prakla.slb.com>
Date: Wed, 16 May 2001 09:27:15 +0100
From: Don Scales <scaled AT gatwick DOT geco-prakla DOT slb DOT com>
X-Mailer: Mozilla 4.76 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: clock subroutine in mingw returns wall clock times

There seems to be a problem with the clock subroutine in the mingw
library
libcrtdll.a
This subroutine should return the number of CPU clock ticks used by the
program at the time the subroutine is called.
The clock routine in the cygwin library works ok.
The clock routine in the mingw library seems to return wall clock time.
Regards
Don
----
#include <time.h>
#include <stdio.h>
int main() {
  long ca,cb,wa,wb;
  float c,w;
  char s[10];
  ca = clock();
  wa=time(0);
  printf("hit enter when ready");
  gets(s);
  cb=clock();
  wb=time(0);
  c=(float) cb-ca;
  w=(float)wb-wa;
  c = c/(float)CLOCKS_PER_SEC;
  printf("wall=%f, cpu=%f\n",w,c);
}



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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