命名空间
变体
操作

std::chrono::file_clock

来自 cppreference.cn
< cpp‎ | chrono
 
 
 
 
定义于头文件 <chrono>
using file_clock = /* 见下文 */;
(C++20 起)

std::chrono::file_clock 是用于 std::filesystem::file_time_type 的时钟的别名。其纪元未指定。

file_clock 满足 TrivialClock 要求。

目录

时间点家族

定义在命名空间 std::chrono
template<class Duration>
using file_time = std::chrono::time_point<std::chrono::file_clock, Duration>;
(C++20 起)
file_time 执行流输出
(函数模板) [编辑]
根据提供的格式从流中解析 file_time
(函数模板) [编辑]
file_time 的格式化支持
(类模板特化) [编辑]

[编辑] 成员类型

成员类型 定义
rep 带符号算术类型,表示时钟持续时间内的“滴答”数
period 一个 std::ratio 类型,表示时钟的“滴答”周期,以秒为单位
duration std::chrono::duration<rep, period>,能够表示负持续时间
time_point std::chrono::time_point<std::chrono::file_clock>

[编辑] 成员常量

constexpr bool is_steady
[静态]
true 如果计时器滴答之间的间隔始终是常量,即 now() 的调用返回的值即使在外部时钟调整的情况下也单调递增,否则为 false
(public static 成员常量)

[编辑] 成员函数

file_clock 提供了以下两对静态成员函数中的一对

  • to_utcfrom_utc;或
  • to_sysfrom_sys
[静态]
返回表示当前时间点的 std::chrono::time_point
(public static member function) [编辑]
[static] (可选)
file_timeutc_time 之间转换
(public static member function) [编辑]
[static] (可选)
file_timesys_time 之间转换
(public static member function) [编辑]