🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.lang.c
Article #15128

Re: notion de temps

#15128
From: Emmanuel Delahaye
Date: Wed, 05 Oct 2005 17:35
20 lines
1448 bytes
Pierre Maurette wrote on 05/10/05 :
>> Comment avoir une notion de temps en C ?
> La seule chose portable que je vois, c'est clock()  de <time.h>:
>
> #include <time.h>
> /* ..... */
> int attente_sec = 3;
> clock_t fin = clock() + (CLOCKS_PER_SEC * attente_sec );
> while(clock() < fin);
T'en loupe pas une...

Non. Il faut utiliser time() (temps 'pendule' ou /wallclock/), car 
clock(), c'est du temps CPU...

-- 
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

.sig under repair
Technical Details
Message-ID: <mn.2c977d5af98f623e.15512@YOURBRAnoos.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!infeed-1.proxad.net!news6-e.free.fr!not-for-mail
References: <dhuute$h61$1@apollon.grec.isp.9tel.net> <mn.2a1a7d5afd420743.31483@laposte.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,4e02ca09709eaded
X-Google-Attributes: gidf9822,public
X-Google-Language: FRENCH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!infeed-1.proxad.net!news6-e.free.fr!not-for-mail
Subject: Re: notion de temps
From: "Emmanuel Delahaye" <emdel@YOURBRAnoos.fr>
References: <dhuute$h61$1@apollon.grec.isp.9tel.net> <mn.2a1a7d5afd420743.31483@laposte.net>
Newsgroups: fr.comp.lang.c
Message-ID: <mn.2c977d5af98f623e.15512@YOURBRAnoos.fr>
X-Newsreader: MesNews/1.04.00.00-fr
Date: Wed, 05 Oct 2005 19:35:25 +0200
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 22
Organization: Guest of ProXad - France
NNTP-Posting-Date: 05 Oct 2005 19:35:26 MEST
NNTP-Posting-Host: 81.65.109.202
X-Trace: 1128533726 news6-e.free.fr 12620 81.65.109.202:29667
X-Complaints-To: abuse@proxad.net