- chrono[meta header]
- std::chrono[meta namespace]
- duration[meta class]
- function[meta id-type]
- cpp11[meta cpp]
constexpr rep count() const;
duration
内の値を取得する。
duration
内のrep
値。
#include <iostream>
#include <chrono>
using std::chrono::duration;
using std::nano;
int main()
{
duration<int, nano> d(2); // 2ナノ秒
std::cout << d.count() << std::endl;
}
- count[color ff0000]
- nano[link /reference/ratio/si_prefix.md]
2
- C++11
- GCC: 4.5.1 [mark verified], 4.6.1 [mark verified]
- Visual C++: 2012 [mark verified], 2013 [mark verified], 2015 [mark verified]