πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #1132

Re: medir tiempo de ejecucion de un proceso

#1132
From: alejandrogarcia
Date: Tue, 14 Mar 2006 15:28
24 lines
2005 bytes
hola mira ya cambie la funcion, en este programita lo manejo con la
funcion time, lo que no se, es como en lugar de la sentencia for(donde
se le da un determinado tiempo ) se maneje con el tiempo de ejecucion
de un proceso

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

int main( void )
{
   long int i=0;
   time_t inicio, fin;

   inicio = time( NULL );
   for( i=0; i<10000; i++ );
   fin = time( NULL );

   printf( "Comienzo: %u s\n", inicio );
   printf( "Final: %u s\n", fin );
   printf( "NΓΊmero de segundos transcurridos desde el comienzo del
programa: %f s\n", difftime(final, comienzo) );

      return 0;
}
Technical Details
Message-ID: <1142350087.851333.247870@j33g2000cwa.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!j33g2000cwa.googlegroups.com!not-for-mail
References: <1142318298.429488.274930@e56g2000cwe.googlegroups.com> <Pine.LNX.4.64.0603141243450.20330@jvz.es>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,a4ba6f3038af4e80
X-Google-Attributes: gidf86c8,public
X-Google-Language: SPANISH,ASCII
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!j33g2000cwa.googlegroups.com!not-for-mail
From: "alejandrogarcia" <alejogf@gmail.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: medir tiempo de ejecucion de un proceso
Date: 14 Mar 2006 07:28:07 -0800
Organization: http://groups.google.com
Lines: 25
Message-ID: <1142350087.851333.247870@j33g2000cwa.googlegroups.com>
References: <1142318298.429488.274930@e56g2000cwe.googlegroups.com>
   <Pine.LNX.4.64.0603141243450.20330@jvz.es>
NNTP-Posting-Host: 200.31.20.174
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1142350093 25872 127.0.0.1 (14 Mar 2006 15:28:13 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 14 Mar 2006 15:28:13 +0000 (UTC)
In-Reply-To: <Pine.LNX.4.64.0603141243450.20330@jvz.es>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.0 proxypichincha:8080 (Squid/2.4.STABLE7)
Complaints-To: groups-abuse@google.com
Injection-Info: j33g2000cwa.googlegroups.com; posting-host=200.31.20.174;
   posting-account=QU71ZQ0AAACGoge_ww9ANEVsJikkaBML