Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>For C++03</strong>:</p> <p><a href="http://www.boost.org/doc/libs/1_40_0/libs/timer/timer.htm" rel="nofollow noreferrer">Boost.Timer</a> might work, but it depends on the C function <code>clock</code> and so may not have good enough resolution for you.</p> <p>Boost.Date_Time includes a <a href="http://www.boost.org/doc/libs/1_37_0/doc/html/date_time/posix_time.html" rel="nofollow noreferrer"><code>ptime</code> class</a> that's been recommended on Stack Overflow before. See its docs on <code>microsec_clock::local_time</code> and <code>microsec_clock::universal_time</code>, but note its caveat that "Win32 systems often do not achieve microsecond resolution via this API."</p> <p><a href="http://stlsoft.org/" rel="nofollow noreferrer">STLsoft</a> provides, among other things, thin cross-platform (Windows and Linux/Unix) C++ wrappers around OS-specific APIs. Its <a href="http://www.stlsoft.org/doc-1.9/group__group____library____performance.html" rel="nofollow noreferrer">performance library</a> has several classes that would do what you need. (To make it cross platform, pick a class like <code>performance_counter</code> that exists in both the <code>winstl</code> and <code>unixstl</code> namespaces, then use whichever namespace matches your platform.)</p> <p><strong>For C++11 and above</strong>:</p> <p>The <code>std::chrono</code> library has this functionality built in. See <a href="https://stackoverflow.com/a/5524138/25507">this answer</a> by @HowardHinnant for details.</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.
    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