Caro Visitante, por que não gastar alguns segundos e criar uma Conta no Fórum Valinor? Desta forma, além de não ver este aviso novamente, poderá participar de nossa comunidade, inserir suas opiniões e sugestões, fazendo parte deste que é um maiores Fóruns de Discussão do Brasil! Aproveite e cadastre-se já!
A função difftime retorna um double, TT1, e calcula a diferença entre dois registros de tempo deste tipo louco time_t (que acho que é da biblioteca time.h, que vc tá tentando usar)C++ disse:#include <time.h>
void main(){
time_t t1,t2;
time(&t1);
/*AQUI VEM O PROCESSO*/
time(&t2);
double diferenca = difftime(t2,t1);
# time ls
artigo.tex Pazzani.pdf
boospamev.ps redes.bib
cartilha-06-spam.pdf sbc2003.sty
clust.pdf sbc-template-latex.zip
diagramas.xmi spam98.ps
MafraFraga-ConfiguracaoDeFiltrosSpamVirus-2004.pdf spam.bib
real 0m0.036s
user 0m0.002s
sys 0m0.002s
time man page disse:The time command runs the specified program command with the given
arguments. When command finishes, time writes a message to standard
output giving timing statistics about this program run. These statis-
tics consist of (i) the elapsed real time between invocation and termi-
nation, (ii) the user CPU time (the sum of the tms_utime and tms_cutime
values in a struct tms as returned by times(2)), and (iii) the system
CPU time (the sum of the tms_stime and tms_cstime values in a struct
tms as returned by times(2)).
Varatar disse:Que eu me lembre, as bibliotecas de tempo (como time.h, por exemplo) possuem funções diferentes dependendo do ambiente (Unix ou Windows).
Varatar disse:Ah, e bEla assinatura, Erulasto ..![]()