std::chrono::system_clock::now
Da cppreference.com.
< cpp | chrono | system clock
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
static std::chrono::time_point<std::chrono::system_clock> now(); |
(dal C++11) | |
Restituisce un punto temporale che rappresenta il momento attuale.
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.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica] Parametri
(Nessuno)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifica] Valore di ritorno
Un punto ora che rappresenta l'ora corrente.
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.
You can help to correct and verify the translation. Click here for instructions.
[modifica] Eccezioni
[modifica] Esempio
#include <iostream> #include <vector> #include <chrono> int main() { for (unsigned long long 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'; } }
Possible output:
1: 1 10: 2 100: 3 1000: 6 10000: 47 100000: 507 1000000: 4822