Espaços nominais
Variantes
Acções

std::chrono::system_clock::now

Da cppreference.com
< cpp‎ | chrono‎ | system clock

 
 
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::system_clock
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.
system_clock::now
system_clock::to_time_t
system_clock::from_time_t
 
(desde C++11)
Retorna um ponto de tempo, representando, com o ponto atual no tempo.
Original:
Returns a time point representing with the current point in time.
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

(Nenhum)
Original:
(none)
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

Um ponto de tempo representa o tempo atual.
Original:
A time point representing the current time.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar]Exceções

noexcept specification:  
noexcept
  (desde C++11)

[editar]Exemplo

#include <iostream>#include <vector>#include <chrono>   int main(){for(unsignedlonglong size =1; size <10000000; size *=10){auto start = std::chrono::system_clock::now();std::vector<int> v(size, 42);auto end = std::chrono::system_clock::now();   auto elapsed = end - start;std::cout<< size <<": "<< elapsed.count()<<'\n';}}

Potencial saída:

1: 1 10: 2 100: 3 1000: 6 10000: 47 100000: 507 1000000: 4822
close