📄 timexlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/timexLib.html - generated by refgen from timexLib.c --> <title> timexLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Libraries</i></a></p></blockquote><h1>timexLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>timexLib</strong> - execution timer facilities </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./timexLib.html#timexInit">timexInit</a></i>( )</b> - include the execution timer library<br><b><i><a href="./timexLib.html#timexClear">timexClear</a></i>( )</b> - clear the list of function calls to be timed<br><b><i><a href="./timexLib.html#timexFunc">timexFunc</a></i>( )</b> - specify functions to be timed<br><b><i><a href="./timexLib.html#timexHelp">timexHelp</a></i>( )</b> - display synopsis of execution timer facilities<br><b><i><a href="./timexLib.html#timex">timex</a></i>( )</b> - time a single execution of a function or functions<br><b><i><a href="./timexLib.html#timexN">timexN</a></i>( )</b> - time repeated executions of a function or group of functions<br><b><i><a href="./timexLib.html#timexPost">timexPost</a></i>( )</b> - specify functions to be called after timing<br><b><i><a href="./timexLib.html#timexPre">timexPre</a></i>( )</b> - specify functions to be called prior to timing<br><b><i><a href="./timexLib.html#timexShow">timexShow</a></i>( )</b> - display the list of function calls to be timed<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains routines for timing the execution of programs,individual functions, and groups of functions. The VxWorks system clockis used as a time base. Functions that have a short execution timerelative to this time base can be called repeatedly to establish anaverage execution time with an acceptable percentage of error.<p>Up to four functions can be specified to be timed as a group.Additionally, sets of up to four functions can be specified as pre- orpost-timing functions, to be executed before and after the timed functions.The routines <b><i><a href="./timexLib.html#timexPre">timexPre</a></i>( )</b> and <b><i><a href="./timexLib.html#timexPost">timexPost</a></i>( )</b> are used to specify the pre- andpost-timing functions, while <b><i><a href="./timexLib.html#timexFunc">timexFunc</a></i>( )</b> specifies the functions tobe timed.<p>The routine <b><i><a href="./timexLib.html#timex">timex</a></i>( )</b> is used to time a single execution of a function orgroup of functions. If called with no arguments, <b><i><a href="./timexLib.html#timex">timex</a></i>( )</b> uses thefunctions in the lists created by calls to <b><i><a href="./timexLib.html#timexPre">timexPre</a></i>( )</b>, <b><i><a href="./timexLib.html#timexPost">timexPost</a></i>( )</b>, and<b><i><a href="./timexLib.html#timexFunc">timexFunc</a></i>( )</b>. If called with arguments, <b><i><a href="./timexLib.html#timex">timex</a></i>( )</b> times the functionspecified, instead of the previous list. The routine <b><i><a href="./timexLib.html#timexN">timexN</a></i>( )</b> works inthe same manner as <b><i><a href="./timexLib.html#timex">timex</a></i>( )</b> except that it iterates the function calls tobe timed.<p></blockquote><h4>EXAMPLES</h4><blockquote><p>The routine <b><i><a href="./timexLib.html#timex">timex</a></i>( )</b> can be used to obtain the execution time of a singleroutine:<pre> -> timex myFunc, myArg1, myArg2, ...</pre>The routine <b><i><a href="./timexLib.html#timexN">timexN</a></i>( )</b> calls a function repeatedly until a 2% or bettertolerance is obtained:<pre> -> timexN myFunc, myArg1, myArg2, ...</pre>The routines <b><i><a href="./timexLib.html#timexPre">timexPre</a></i>( )</b>, <b><i><a href="./timexLib.html#timexPost">timexPost</a></i>( )</b>, and <b><i><a href="./timexLib.html#timexFunc">timexFunc</a></i>( )</b> are used to specifya list of functions to be executed as a group:<pre> -> timexPre 0, myPreFunc1, preArg1, preArg2, ... -> timexPre 1, myPreFunc2, preArg1, preArg2, ... -> timexFunc 0, myFunc1, myArg1, myArg2, ... -> timexFunc 1, myFunc2, myArg1, myArg2, ... -> timexFunc 2, myFunc3, myArg1, myArg2, ... -> timexPost 0, myPostFunc, postArg1, postArg2, ...</pre>The list is executed by calling <b><i><a href="./timexLib.html#timex">timex</a></i>( )</b> or <b><i><a href="./timexLib.html#timexN">timexN</a></i>( )</b> without arguments:<pre> -> timexor -> timexN</pre>In this example, <i>myPreFunc1</i> and <i>myPreFunc2</i> are called with theirrespective arguments. <i>myFunc1</i>, <i>myFunc2</i>, and <i>myFunc3</i> are thencalled in sequence and timed. If <b><i><a href="./timexLib.html#timexN">timexN</a></i>( )</b> was used, the sequence iscalled repeatedly until a 2% or better error tolerance is achieved.Finally, <i>myPostFunc</i> is called with its arguments. The timing resultsare reported after all post-timing functions are called.<p></blockquote><h4>NOTE</h4><blockquote><p>The timings measure the execution time of the routine body, without theusual subroutine entry and exit code (usually LINK, UNLINK, and RTSinstructions). Also, the time required to set up the arguments andcall the routines is not included in the reported times. This isbecause these timing routines automatically calibrate themselves bytiming the invocation of a null routine, and thereafter subtractingthat constant overhead.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>timexLib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./timexLib.html#top">timexLib</a></b>, <b><a href="./spyLib.html#top">spyLib</a></b><hr><a name="timexInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>timexInit</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>timexInit</i>( )</strong> - include the execution timer library</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void timexInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This null routine is provided so that <b><a href="./timexLib.html#top">timexLib</a></b> can be linked into the system.If the configuration macro <b>INCLUDE_TIMEX</b> is defined, it is called by theroot task, <b><i><a href="./usrConfig.html#usrRoot">usrRoot</a></i>( )</b>, in <b>usrConfig.c</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./timexLib.html#top">timexLib</a></b><hr><a name="timexClear"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>timexClear</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>timexClear</i>( )</strong> - clear the list of function calls to be timed</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void timexClear (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine clears the current list of functions to be timed.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./timexLib.html#top">timexLib</a></b><hr><a name="timexFunc"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>timexFunc</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>timexFunc</i>( )</strong> - specify functions to be timed</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void timexFunc ( int i, /* function number in list (0..3) */ FUNCPTR func, /* function to be added (NULL if to be deleted) */ int arg1, /* first of up to 8 args to call function with */ int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8 )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds or deletes functions in the list of functionsto be timed as a group by calls to <b><i><a href="./timexLib.html#timex">timex</a></i>( )</b> or <b><i><a href="./timexLib.html#timexN">timexN</a></i>( )</b>. Up to fourfunctions can be included in the list. The argument <i>i</i> specifies thefunction's position in the sequence of execution (0, 1, 2, or 3).A function is deleted by specifying its sequence number <i>i</i> and NULL for thefunction argument <i>func</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./timexLib.html#top">timexLib</a></b>, <b><i><a href="./timexLib.html#timex">timex</a></i>( )</b>, <b><i><a href="./timexLib.html#timexN">timexN</a></i>( )</b><hr><a name="timexHelp"></a><p align=right><a href="rtnIndex.html"><i>Libraries : Routines</i></a></p></blockquote><h1><i>timexHelp</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>timexHelp</i>( )</strong> - display synopsis of execution timer facilities</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void timexHelp (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine displays the following summary of the availableexecution timer functions:<pre> timexHelp Print this list. timex [func,[args...]] Time a single execution. timexN [func,[args...]] Time repeated executions. timexClear Clear all functions. timexFunc i,func,[args...] Add timed function number i (0,1,2,3).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -