Espaços nominais
Variantes
Acções

std::difftime

Da cppreference.com
< cpp‎ | chrono‎ | c

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
(C++11)
Os operadores relacionais
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares e tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Troque, avançar e avançar
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
(C++11)
(C++11)
 
 
C estilo de utilitários de data e hora
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação do tempo
Original:
Time manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
difftime
Conversões de formato
Original:
Format conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Definido no cabeçalho <ctime>
double difftime( time_t time2, time_t time1 );
Calcula diferença entre duas horas de calendário como objetos time_t (time2 - time1) em segundos.
Original:
Computes difference between two calendar times as time_t objects (time2 - time1) in seconds.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar]Parâmetros

time1, time2 -
vezes para comparar
Original:
times to compare
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Valor de retorno

Diferença entre duas vezes no segundo
Original:
Difference between two times in seconds
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Exemplo

#include <iostream>#include <ctime>int main(){std::time_t start =std::time(NULL);volatiledouble d;for(int n=0; n<10000;++n)for(int m=0; m<100000;++m) d += d*n*m;// some time-consuming operationstd::cout<<"Wall time passed: "<< std::difftime(std::time(NULL), start)<<" s.\n";}

Saída:

Wall time passed: 7 s.

[editar]Veja também

(C++11)
um intervalo de tempo
Original:
a time interval
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de classe)[edit]
Documentação C para difftime
close