Espaços nominais
Variantes
Acções

std::chrono::time_point

Da cppreference.com
< cpp‎ | chrono

 
 
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)
 
 
std::chrono::time_point
Funções de membro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
time_point::time_point
time_point::time_since_epoch
time_point::operator+
time_point::operator-
time_point::min
time_point::max
Não-membros funções
Original:
Non-member functions
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 <chrono>
template<

    class Clock,
    class Duration =typename Clock::duration

>class time_point;
(desde C++11)
std::chrono::time_point modelo de classe representa um ponto no tempo. Ele é implementado como se armazena um valor do tipo Duration indica o intervalo de tempo desde o início da época do Clock de.
Original:
Class template std::chrono::time_point represents a point in time. It is implemented as if it stores a value of type Duration indicating the time interval from the start of the Clock's epoch.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Índice

[editar]Tipos de membro

Tipo de membro
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
clock
Clock, o relógio em que este ponto de tempo é medido
Original:
Clock, the clock on which this time point is measured
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
duration
Duration, um tipo std::chrono::duration utilizado para medir o tempo decorrido desde epoch
Original:
Duration, a std::chrono::duration type used to measure the time since epoch
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rep
Rep, um tipo de aritmética que representa o número de carrapatos de duração
Original:
Rep, an arithmetic type representing the number of ticks of the duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
period
Period, um tipo std::ratio representa o período de duração do carrapato
Original:
Period, a std::ratio type representing the tick period of the duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Funções de membro

constrói um ponto novo tempo
Original:
constructs a new time point
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função pública membro)[edit]
retorna o ponto de tempo como a duração desde o início do seu relógio
Original:
returns the time point as duration since the start of its clock
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função pública membro)[edit]
modifica o ponto no tempo determinado pela duração
Original:
modifies the time point by the given duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função pública membro)[edit]
[estática]
retorna o ponto de tempo correspondente à duração menor
Original:
returns the time point corresponding to the smallest duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função public static membro)[edit]
[estática]
returns the time point corresponding to the largest duration
(função public static membro)[edit]

[editar]Não-membros funções

especializa o traço std::common_type
Original:
specializes the std::common_type trait
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(especialização modelo. classe)[edit]
modifica o ponto no tempo determinado pela duração
Original:
modifies the time point by the given duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de função)[edit]
compara dois pontos de tempo
Original:
compares two time points
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(modelo de função)[edit]
converts a time point to another time point on the same clock, with a different duration
(modelo de função)[edit]

[editar]Exemplo

Esse exemplo imprime o tempo atual, menos de 24 horas:
Original:
This example prints the current time minus 24 hours:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <iostream>#include <iomanip>#include <ctime>#include <chrono>   int main(){ std::chrono::time_point<std::chrono::system_clock> now; now = std::chrono::system_clock::now();std::time_t now_c = std::chrono::system_clock::to_time_t( now -std::chrono::hours(24));std::cout<<"One day ago, the time was "<<std::put_time(std::localtime(&now_c), "%F %T")<<'\n';}

Potencial saída:

One day ago, the time was 2011-10-25 12:00:08

[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)
close