I would like to convert time points from different clocks. Currently I follow the suggestion from here.
static auto ref_sys_clk = std::chrono::system_clock::now();
static auto ref_std_clk = std::chrono::high_resolution_clock::now();
auto to_sys_clk(std::chrono::high_resolution_clock::time_point tp)
{
//return std::chrono::clock_cast<std::chrono::system_clock::time_point>(tp);
return ref_sys_clk + std::chrono::duration_cast<std::chrono::system_clock::duration>(tp - ref_std_clk);
}
How can I utilize clock_cast
for this purpose. Currently I use Visual Studio 2019.