/usr/share/doc/libqb-dev/html/qb_util_overview.html is in libqb-doc 1.0.1-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libqb: Common Utilities</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libqb
 <span id="projectnumber">1.0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="index.html">index</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Common Utilities </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>These are some convience functions used throughout libqb.</p>
<dl class="section author"><dt>Author</dt><dd>Angus Salkeld <a href="#" onclick="location.href='mai'+'lto:'+'asa'+'lk'+'eld'+'@r'+'edh'+'at'+'.co'+'m'; return false;">asalk<span style="display: none;">.nosp@m.</span>eld@<span style="display: none;">.nosp@m.</span>redha<span style="display: none;">.nosp@m.</span>t.co<span style="display: none;">.nosp@m.</span>m</a></dd></dl>
<dl class="section user"><dt>Locking</dt><dd><ul>
<li><a class="el" href="qbutil_8h.html#acde9208939629b303753ab6ba39d833d" title="Create a new lock of the given type. ">qb_thread_lock_create()</a></li>
<li><a class="el" href="qbutil_8h.html#a6c8d078f2abdc3f05566243d248d65c0" title="Calls either pthread_mutex_lock() or pthread_spin_lock(). ">qb_thread_lock()</a></li>
<li><a class="el" href="qbutil_8h.html#a94e123b6dbfeecdc4b1d858753805ef2" title="Calls either pthread_mutex_trylock() or pthread_spin_trylock(). ">qb_thread_trylock()</a></li>
<li><a class="el" href="qbutil_8h.html#abaec9c70fe499d80f4ae653bc2175edb" title="Calls either pthread_mutex_unlock() or pthread_spin_unlock. ">qb_thread_unlock()</a></li>
<li><a class="el" href="qbutil_8h.html#adb78908caab9a669a379bc42d5a6dac5" title="Calls either pthread_mutex_destro() or pthread_spin_destroy(). ">qb_thread_lock_destroy()</a></li>
</ul>
</dd></dl>
<dl class="section user"><dt>Time functions</dt><dd><ul>
<li><a class="el" href="qbutil_8h.html#af43673536bca07cda470d7e14a9a23ce" title="Add milliseconds onto the timespec. ">qb_timespec_add_ms()</a></li>
<li><a class="el" href="qbutil_8h.html#a83f88f8044d00d65deb0d2518b92f483" title="Get the current number of nano secounds produced by the systems incrementing clock (CLOCK_MONOTOMIC i...">qb_util_nano_current_get()</a></li>
<li><a class="el" href="qbutil_8h.html#ac64ade83e806ee9f35e9e537b1bff424" title="Get the frequence of the clock used in qb_util_nano_current_get(). ">qb_util_nano_monotonic_hz()</a></li>
<li><a class="el" href="qbutil_8h.html#aca5e42b6460996d6934531acfaa6da15" title="Get the time in nano seconds since epoch. ">qb_util_nano_from_epoch_get()</a></li>
<li><a class="el" href="qbutil_8h.html#ae4f5fdaf1b55786de7f7799595ca330b" title="Get the time in timespec since epoch. ">qb_util_timespec_from_epoch_get()</a></li>
</ul>
</dd></dl>
<dl class="section user"><dt>Basic Stopwatch</dt><dd><div class="fragment"><div class="line">uint64_t elapsed1;</div><div class="line">uint64_t elapsed2;</div><div class="line"><a class="code" href="qbutil_8h.html#aa03c7b8050f4a3ec5c9c1a01bc5bcb1a">qb_util_stopwatch_t</a> *sw = <a class="code" href="qbutil_8h.html#ac73142ada183f9afadf9767aba115ba4">qb_util_stopwatch_create</a>();</div><div class="line"></div><div class="line"><a class="code" href="qbutil_8h.html#a10966bfe658b4f4ebffeff634be8b7f5">qb_util_stopwatch_start</a>(sw);</div><div class="line"></div><div class="line">usleep(sometime);</div><div class="line"><a class="code" href="qbutil_8h.html#a6729a9b9709b524641043b5d886894c2">qb_util_stopwatch_stop</a>(sw);</div><div class="line">elapsed1 = <a class="code" href="qbutil_8h.html#a54a18c41f22282b444119834f4ace584">qb_util_stopwatch_us_elapsed_get</a>(sw);</div><div class="line"></div><div class="line">usleep(somemoretime);</div><div class="line"><a class="code" href="qbutil_8h.html#a6729a9b9709b524641043b5d886894c2">qb_util_stopwatch_stop</a>(sw);</div><div class="line">elapsed2 = <a class="code" href="qbutil_8h.html#a54a18c41f22282b444119834f4ace584">qb_util_stopwatch_us_elapsed_get</a>(sw);</div><div class="line"></div><div class="line"><a class="code" href="qbutil_8h.html#acbbf8ceb60791e43679990f7015c3789">qb_util_stopwatch_free</a>(sw);</div></div><!-- fragment --></dd></dl>
<dl class="section user"><dt>Stopwatch with splits</dt><dd>Setup a stopwatch with space for 3 splits.</dd></dl>
<div class="fragment"><div class="line">uint64_t split;</div><div class="line"><a class="code" href="qbutil_8h.html#aa03c7b8050f4a3ec5c9c1a01bc5bcb1a">qb_util_stopwatch_t</a> *sw = <a class="code" href="qbutil_8h.html#ac73142ada183f9afadf9767aba115ba4">qb_util_stopwatch_create</a>();</div><div class="line"></div><div class="line"><a class="code" href="qbutil_8h.html#af01ad773b0003f5e1f50886894907e31">qb_util_stopwatch_split_ctl</a>(sw, 3, 0);</div><div class="line"><a class="code" href="qbutil_8h.html#a10966bfe658b4f4ebffeff634be8b7f5">qb_util_stopwatch_start</a>(sw);</div><div class="line"></div><div class="line">usleep(sometime);</div><div class="line"><a class="code" href="qbutil_8h.html#a4186d59a3429de3a0224ace84aa164c9">qb_util_stopwatch_split</a>(sw);</div><div class="line"></div><div class="line">usleep(somemoretime);</div><div class="line"><a class="code" href="qbutil_8h.html#a4186d59a3429de3a0224ace84aa164c9">qb_util_stopwatch_split</a>(sw);</div><div class="line"></div><div class="line">usleep(somemoretime);</div><div class="line"><a class="code" href="qbutil_8h.html#a4186d59a3429de3a0224ace84aa164c9">qb_util_stopwatch_split</a>(sw);</div><div class="line"></div><div class="line">idx = <a class="code" href="qbutil_8h.html#a201150e4e5c57f9f729b3d5bd3877768">qb_util_stopwatch_split_last</a>(sw);</div><div class="line"><span class="keywordflow">do</span> {</div><div class="line"> split = <a class="code" href="qbutil_8h.html#a8c00de55c0ab48c72dc601f7a4713798">qb_util_stopwatch_time_split_get</a>(sw, idx, idx);</div><div class="line"> <a class="code" href="qblog_8h.html#ac1dcd0ac044680eead32eae864928d71">qb_log</a>(LOG_INFO, <span class="stringliteral">"split %d is %"</span>PRIu64<span class="stringliteral">""</span>, last, split);</div><div class="line"> idx--;</div><div class="line">} <span class="keywordflow">while</span> (split > 0);</div><div class="line"></div><div class="line">split = <a class="code" href="qbutil_8h.html#a8c00de55c0ab48c72dc601f7a4713798">qb_util_stopwatch_time_split_get</a>(sw, 2, 1);</div><div class="line"><a class="code" href="qblog_8h.html#ac1dcd0ac044680eead32eae864928d71">qb_log</a>(LOG_INFO, <span class="stringliteral">"time between second and third split is %"</span>PRIu64<span class="stringliteral">""</span>, split);</div><div class="line"></div><div class="line"><a class="code" href="qbutil_8h.html#acbbf8ceb60791e43679990f7015c3789">qb_util_stopwatch_free</a>(sw);</div></div><!-- fragment --> <dl class="section see"><dt>See also</dt><dd><a class="el" href="qbutil_8h.html" title="These are some convience functions used throughout libqb. ">qbutil.h</a> </dd></dl>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
|