Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can use <code>boost::posix_time::time_duration</code> to get the time range. E.g like this</p> <pre><code>boost::posix_time::time_duration diff = tick - now; diff.total_milliseconds(); </code></pre> <p>And to get a higher resolution you can change the clock you are using. For example to the <code>boost::posix_time::microsec_clock</code>, though this can be OS dependent. On Windows, for example, <code>boost::posix_time::microsecond_clock</code> has milisecond resolution, not microsecond.</p> <p>An example which is a little dependent on the hardware.</p> <pre><code>int main(int argc, char* argv[]) { boost::posix_time::ptime t1 = boost::posix_time::second_clock::local_time(); boost::this_thread::sleep(boost::posix_time::millisec(500)); boost::posix_time::ptime t2 = boost::posix_time::second_clock::local_time(); boost::posix_time::time_duration diff = t2 - t1; std::cout &lt;&lt; diff.total_milliseconds() &lt;&lt; std::endl; boost::posix_time::ptime mst1 = boost::posix_time::microsec_clock::local_time(); boost::this_thread::sleep(boost::posix_time::millisec(500)); boost::posix_time::ptime mst2 = boost::posix_time::microsec_clock::local_time(); boost::posix_time::time_duration msdiff = mst2 - mst1; std::cout &lt;&lt; msdiff.total_milliseconds() &lt;&lt; std::endl; return 0; } </code></pre> <p>On my win7 machine. The first out is either 0 or 1000. Second resolution. The second one is nearly always 500, because of the higher resolution of the clock. I hope that help a little.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload