title: C++ chrono - get duration as float or long long
body: <p>I have a duration</p>
  
  <pre><code>typedef std::chrono::high_resolution_clock Clock;
  Clock::time_point       beginTime;
  Clock::time_point       endTime;
  auto duration = std::chrono::duration_cast&lt;std::chrono::milliseconds&gt;(endTime - beginTime);
  </code></pre>
  
  <p>And I get <code>duration</code> in <code>std::chrono::milliseconds</code>. But I need <code>duration</code> as <code>float</code> or <code>long long</code>. How to do that?</p>