草庐IT

microfortnights

全部标签

c++ - 形成自定义 std::chrono::durations 和 std::ratio 的最佳方法是什么?

我正在阅读thisexcellentanswer使用滑稽的持续时间单位microfortnights以令人难忘的方式说明一个要点。typedefstd::ratiomicrofortnights;std::chrono::durationtwo_weeks(1000000);我想到了这个问题:IfIreallywantedtodothis(morelikelysomeothernon-trivialdurationsuchasthetimeavailableduringaframe,orduringNcyclesofaprocessor),whatisthebestwaytodothi

c++ - 形成自定义 std::chrono::durations 和 std::ratio 的最佳方法是什么?

我正在阅读thisexcellentanswer使用滑稽的持续时间单位microfortnights以令人难忘的方式说明一个要点。typedefstd::ratiomicrofortnights;std::chrono::durationtwo_weeks(1000000);我想到了这个问题:IfIreallywantedtodothis(morelikelysomeothernon-trivialdurationsuchasthetimeavailableduringaframe,orduringNcyclesofaprocessor),whatisthebestwaytodothi