www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/31/21:00:05

From: "Gwen" <mb11363 AT chello DOT be>
Subject: Re: question about getkey() , time() and how to pick a char from the screen
Newsgroups: comp.os.msdos.djgpp
References: <01c11959$9c6f2d00$108784d5 AT feta> <9k5va9$r56$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
Message-ID: <01c11a24$ba127080$108784d5@feta>
X-Newsreader: Microsoft Internet News 4.70.1162
Lines: 18
Date: Wed, 01 Aug 2001 00:48:08 GMT
NNTP-Posting-Host: 213.132.135.16
X-Complaints-To: abuse AT chello DOT be
X-Trace: news.chello.be 996626888 213.132.135.16 (Wed, 01 Aug 2001 02:48:08 MET DST)
NNTP-Posting-Date: Wed, 01 Aug 2001 02:48:08 MET DST
Organization: Chello Usenet Service
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com


Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote in article
<9k5va9$r56$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>...
> According to the scriptures, you should never do any arithmetics on
> time_t yourself. The language standard doesn't let you know what a
> time_t variable really contains. Instead, you should use the
> 'difftime()' function, which exists exactly for that purpose.

yes difftime() is what I needed, but it's in second too.
I tried some stuff with the number of ticks from the clock (function clock
() : 91 ticks=1 second), it gives good result.
Doing arithmetic with the clock_t type is certainly not very elegant, but
it works in my case ( there isn't a function like diffclock() ). 

btw, thanks for your help !

Gwen

- Raw text -


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