Get chrono seconds in float
<p>In the example at <a href="http://en.cppreference.com/w/cpp/chrono" rel="noreferrer">http://en.cppreference.com/w/cpp/chrono</a> the seconds value is obtained in a <code>double</code>. This is the behavior I want. However, this appears to rely on the implicit assumption that the time point subtraction yields a value that represents seconds. I can not find anything that explains why a duration yields floating point seconds when no time units are actually specified. Without using <code>auto</code> at all, can someone show how to explicitly obtain a time unit such as seconds in a floating point type, or point me to documentation or explanation as to why the aforementioned conversion represents seconds?</p>

<p>The conversion in question is essentially:</p>

<pre><code>std::chrono::time_point&lt;std::chrono::system_clock&gt; start = std::chrono::system_clock::now();
std::chrono::time_point&lt;std::chrono::system_clock&gt; end = std::chrono::system_clock::now();
std::chrono::duration&lt;double&gt; elapsed_seconds = end-start; // why does this represent seconds as opposed to some other time unit?
double secondsInDouble = elapsed_seconds.count();
</code></pre>

<p>See the following posts for examples of the conversion.</p>

<p><a href="https://stackoverflow.com/questions/14391327/how-to-get-duration-as-int-millis-and-float-seconds-from-chrono/14391447#14391447">How to get duration, as int milli&#39;s and float seconds from &lt;chrono&gt;?</a></p>

<p><a href="https://stackoverflow.com/questions/24686781/c-chrono-get-duration-as-float-or-long-long">C++ chrono - get duration as float or long long</a></p>

<p><a href="https://stackoverflow.com/questions/33613659/getting-chrono-time-in-specific-way">getting chrono time in specific way</a></p>

<p><a href="https://stackoverflow.com/questions/20710213/chrono-timer-not-converting-seconds-properly">Chrono Timer Not Converting Seconds Properly</a></p>