名前空間
変種
操作

std::chrono::system_clock::now

提供: cppreference.com
< cpp‎ | chrono‎ | system clock

 
 
ユーティリティライブラリ
支援を入力します (basic types, RTTI, type traits)
動的なメモリ管理
エラー処理
プログラムユーティリティ
可変個引数関数
日付と時刻
関数オブジェクト
initializer_list(C++11)
bitset
hash(C++11)
関係演算子
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>=
ペアとタプル
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.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
フォワード、スワップ、および移動
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.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
 
std::chrono::system_clock
メンバ関数
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
 
(C + + 11以来)
現時点で表す時点を返し.
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.

目次

[編集] パラメータ

(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

現在時刻を表す時点.
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.

[編集] 例外

noexcept specification:  
noexcept
  (C + + 11以来)

[編集]

#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