πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: medir tiempo de ejecucion de un proceso

#1133
From: alejandrogarcia
Date: Tue, 14 Mar 2006 15:33
25 lines
2054 bytes
el printf se puede omitir pero como hago para medir un proceso, no he
dado ya lei el man del time, lo manejo con un for al que se le da un
determinado tiempo, pero lo que se quiere es el tiempo del proceso

en este programita lo manejo con la funcion time, lo que no se,

#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: <1142350407.916792.238340@v46g2000cwv.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews.google.com!v46g2000cwv.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!v46g2000cwv.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:33:27 -0800
Organization: http://groups.google.com
Lines: 26
Message-ID: <1142350407.916792.238340@v46g2000cwv.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 1142350413 26684 127.0.0.1 (14 Mar 2006 15:33:33 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 14 Mar 2006 15:33:33 +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: v46g2000cwv.googlegroups.com; posting-host=200.31.20.174;
   posting-account=QU71ZQ0AAACGoge_ww9ANEVsJikkaBML