名稱空間
變體
操作

std::chrono::file_clock

來自 cppreference.com
< 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) [編輯]