I'm learning <chrono> library, and considering the std::chrono::duration class, is there any specific reason to base it on seconds? For example a variable to store seconds would be
chrono::duration<int> two_seconds(2); and all other time spans require relating them to seconds, like
chrono::duration<int, ratio<60>> two_minutes(2); chrono::duration<int, ratio<1, 1000>> two_milliseconds(2); chrono::duration<int, ratio<60 * 60 * 24>> two_days(2); Are there any reasons to base duration on seconds and not on minutes, hours, etc.?
chrono::durationdoes by itself. You can also use milliseconds as your "base" if you use the typestd::chrono::milliseconds(which is typedefed to what you already posted in your second line of code)