📄 hrtimer_8h-source.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Crypto++: hrtimer.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.2 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Compound Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>hrtimer.h</h1><div class="fragment"><pre>00001 <span class="preprocessor">#ifndef CRYPTOPP_HRTIMER_H</span>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_HRTIMER_H</span>00003 <span class="preprocessor"></span>00004 <span class="preprocessor">#include "config.h"</span>00005 00006 NAMESPACE_BEGIN(CryptoPP)00007 00008 #ifdef HIGHRES_TIMER_AVAILABLE00009 <span class="comment"></span>00010 <span class="comment">//! high resolution timer</span><a name="l00011"></a><a class="code" href="class_timer.html">00011</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_timer.html">Timer</a>00012 {00013 <span class="keyword">public</span>:00014 <span class="keyword">enum</span> Unit {SECONDS, MILLISECONDS, MICROSECONDS};00015 <a class="code" href="class_timer.html">Timer</a>(Unit unit, <span class="keywordtype">bool</span> stuckAtZero = <span class="keyword">false</span>) : m_timerUnit(unit), m_stuckAtZero(stuckAtZero), m_started(<span class="keyword">false</span>) {}00016 00017 <span class="keyword">static</span> word64 GetCurrentTimerValue(); <span class="comment">// GetCurrentTime is a macro in MSVC 6.0</span>00018 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ConvertTo(word64 t, Unit unit);00019 00020 <span class="comment">// this is not the resolution, just a conversion factor into milliseconds</span>00021 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> TicksPerMillisecond()00022 {00023 <span class="preprocessor">#if defined(CRYPTOPP_WIN32_AVAILABLE)</span>00024 <span class="preprocessor"></span> <span class="keywordflow">return</span> 10000;00025 <span class="preprocessor">#elif defined(__unix__) || defined(macintosh)</span>00026 <span class="preprocessor"></span> <span class="keywordflow">return</span> 1000;00027 <span class="preprocessor">#endif</span>00028 <span class="preprocessor"></span> }00029 00030 <span class="keywordtype">void</span> StartTimer();00031 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ElapsedTime();00032 00033 <span class="keyword">private</span>:00034 Unit m_timerUnit; <span class="comment">// HPUX workaround: m_unit is a system macro on HPUX</span>00035 <span class="keywordtype">bool</span> m_stuckAtZero, m_started;00036 word64 m_start;00037 };00038 00039 <span class="preprocessor">#endif</span>00040 <span class="preprocessor"></span>00041 NAMESPACE_END00042 00043 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Jul 8 23:34:16 2003 for Crypto++ by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.2 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -