我是这个
std::chrono::high_resolution_clock::time_point mElapsedTime;
我想将此time_point和另一个time_point之间的差异转换为浮点数,这可能吗?
答案 0 :(得分:2)
您可以使用duration cast
std::chrono::duration<float, std::milli> diff = mElapsedTime - mStartedTime;
//access the float with .count
std::cout<<diff.count()<<'\n';