1 2
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Timeval (posix-time2.Posix_time2.Timeval)</title><link rel="stylesheet" href="../../../odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 1.5.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div class="content"><header><nav><a href="../index.html">Up</a> – <a href="../../index.html">posix-time2</a> » <a href="../index.html">Posix_time2</a> » Timeval</nav><h1>Module <code>Posix_time2.Timeval</code></h1></header><dl><dt class="spec type" id="type-t"><a href="#type-t" class="anchor"></a><code><span class="keyword">type</span> t</code><code> = <span class="keyword">private</span> </code><code>{</code><table class="record"><tr id="type-t.tv_sec" class="anchored"><td class="def field"><a href="#type-t.tv_sec" class="anchor"></a><code>tv_sec : int64;</code></td></tr><tr id="type-t.tv_usec" class="anchored"><td class="def field"><a href="#type-t.tv_usec" class="anchor"></a><code>tv_usec : int64;</code></td></tr></table><code>}</code></dt><dd><p>POSIX timeval time value with seconds and microseconds. A normalized value of type <code>t</code> must have a value of <code>tv_usec</code> between <code>0</code> and <code>1000000</code> (exclusive).</p></dd></dl><dl><dt class="spec value" id="val-create"><a href="#val-create" class="anchor"></a><code><span class="keyword">val</span> create : int64 <span>-></span> int64 <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>create sec usec</code> creates a new normalized timespec with <code>sec</code> seconds and <code>usec</code> microseconds.</p></dd></dl><dl><dt class="spec value" id="val-add"><a href="#val-add" class="anchor"></a><code><span class="keyword">val</span> add : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>add t1 t2</code> adds the two timespec values, returning a normalized value</p></dd></dl><dl><dt class="spec value" id="val-sub"><a href="#val-sub" class="anchor"></a><code><span class="keyword">val</span> sub : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>sub t1 t2</code> subtracts <code>t2</code> from <code>t1</code>, creating a new normalized time value.</p></dd></dl><dl><dt class="spec value" id="val-add_sec"><a href="#val-add_sec" class="anchor"></a><code><span class="keyword">val</span> add_sec : int64 <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>add_sec s t</code> adds <code>s</code> seconds to <code>t</code>.</p></dd></dl><dl><dt class="spec value" id="val-add_usec"><a href="#val-add_usec" class="anchor"></a><code><span class="keyword">val</span> add_usec : int64 <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>add_sec us t</code> adds <code>us</code> microseconds to <code>t</code>.</p></dd></dl><dl><dt class="spec value" id="val-sub_sec"><a href="#val-sub_sec" class="anchor"></a><code><span class="keyword">val</span> sub_sec : int64 <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>sub_sec s t</code> subtracts <code>s</code> seconds from <code>t</code>.</p></dd></dl><dl><dt class="spec value" id="val-sub_usec"><a href="#val-sub_usec" class="anchor"></a><code><span class="keyword">val</span> sub_usec : int64 <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a></code></dt><dd><p><code>sub_sec us t</code> subtracts <code>us</code> microseconds from <code>t</code>.</p></dd></dl><dl><dt class="spec value" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span class="keyword">val</span> to_string : <a href="index.html#type-t">t</a> <span>-></span> string</code></dt><dd><p><code>to_string t</code> creates a string of the form "sec.usec".</p></dd></dl><dl><dt class="spec value" id="val-compare"><a href="#val-compare" class="anchor"></a><code><span class="keyword">val</span> compare : <a href="index.html#type-t">t</a> <span>-></span> <a href="index.html#type-t">t</a> <span>-></span> int</code></dt><dd><p><code>compare t1 t2</code> compares the two time values <code>t1</code> and <code>t2</code>. It returns <code>0</code> if <code>t1</code> is equal to <code>2</code>, a negative integer if <code>t1</code> is less than <code>t2</code>, and a positive integer if <code>t1</code> is greater than <code>t2</code>.</p></dd></dl></div></body></html>
|