⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clocklib.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/clockLib.html - generated by refgen from clockLib.c --> <title> clockLib </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>clockLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>clockLib</strong> - clock library (POSIX) </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./clockLib.html#clock_getres">clock_getres</a></i>(&nbsp;)</b>  -  get the clock resolution (POSIX)<br><b><i><a href="./clockLib.html#clock_setres">clock_setres</a></i>(&nbsp;)</b>  -  set the clock resolution<br><b><i><a href="./clockLib.html#clock_gettime">clock_gettime</a></i>(&nbsp;)</b>  -  get the current time of the clock (POSIX)<br><b><i><a href="./clockLib.html#clock_settime">clock_settime</a></i>(&nbsp;)</b>  -  set the clock to a specified time (POSIX)<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library provides a clock interface, as defined in the IEEE standard,POSIX 1003.1b.<p>A clock is a software construct that keeps time in seconds andnanoseconds.  The clock has a simple interface with three routines:<b><i><a href="./clockLib.html#clock_settime">clock_settime</a></i>(&nbsp;)</b>, <b><i><a href="./clockLib.html#clock_gettime">clock_gettime</a></i>(&nbsp;)</b>, and <b><i><a href="./clockLib.html#clock_getres">clock_getres</a></i>(&nbsp;)</b>.  The non-POSIX routine<b><i><a href="./clockLib.html#clock_setres">clock_setres</a></i>(&nbsp;)</b> is provided (temporarily) so that <b><a href="./clockLib.html#top">clockLib</a></b> is informed if thereare changes in the system clock rate (e.g., after a call to<b><i><a href="./sysLib.html#sysClkRateSet">sysClkRateSet</a></i>(&nbsp;)</b>).<p>Times used in these routines are stored in the timespec structure:<pre>struct timespec    {    time_t      tv_sec;         /* seconds */    long        tv_nsec;        /* nanoseconds (0 -1,000,000,000) */    };</pre></blockquote><h4>IMPLEMENTATION</h4><blockquote><p>Only one <i>clock_id</i> is supported, the required <b>CLOCK_REALTIME</b>.Conceivably, additional "virtual" clocks could be supported, or supportfor additional auxiliary clock hardware (if available) could be added.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>timers.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./clockLib.html#top">clockLib</a></b>, IEEE<i>VxWorks Programmer's Guide: Basic OS, </i>POSIX 1003.1b documentation<p><hr><a name="clock_getres"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>clock_getres</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>clock_getres</i>(&nbsp;)</strong> - get the clock resolution (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int clock_getres    (    clockid_t         clock_id, /* clock ID (always CLOCK_REALTIME) */    struct timespec * res       /* where to store resolution */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the clock resolution, in nanoseconds, based on therate returned by <b><i><a href="./sysLib.html#sysClkRateGet">sysClkRateGet</a></i>(&nbsp;)</b>.  If <i>res</i> is non-NULL, the resolution isstored in the location pointed to.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>0 (OK), or -1 (ERROR) if <i>clock_id</i> is invalid.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./clockLib.html#top">clockLib</a></b>, <b><i><a href="./clockLib.html#clock_settime">clock_settime</a></i>(&nbsp;)</b>, <b><i><a href="./sysLib.html#sysClkRateGet">sysClkRateGet</a></i>(&nbsp;)</b>, <b><i><a href="./clockLib.html#clock_setres">clock_setres</a></i>(&nbsp;)</b><hr><a name="clock_setres"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>clock_setres</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>clock_setres</i>(&nbsp;)</strong> - set the clock resolution</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int clock_setres    (    clockid_t         clock_id, /* clock ID (always CLOCK_REALTIME) */    struct timespec * res       /* resolution to be set */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the clock resolution in the POSIX timers data structures.It does not affect the system clock or auxiliary clocks.This routine should be called to inform the POSIX timers of the new clockresolution if <b><i><a href="./sysLib.html#sysClkRateSet">sysClkRateSet</a></i>(&nbsp;)</b> has been called after this library has beeninitialized.<p>If <i>res</i> is non-NULL, the resolution to be set is stored in the locationpointed to; otherwise, this routine has no effect.<p></blockquote><h4>NOTE</h4><blockquote><p>Non-POSIX.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>0 (OK), or -1 (ERROR) if <i>clock_id</i> is invalid or the resolution is greater than 1 second.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./clockLib.html#top">clockLib</a></b>, <b><i><a href="./clockLib.html#clock_getres">clock_getres</a></i>(&nbsp;)</b>, <b><i><a href="./sysLib.html#sysClkRateSet">sysClkRateSet</a></i>(&nbsp;)</b><hr><a name="clock_gettime"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>clock_gettime</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>clock_gettime</i>(&nbsp;)</strong> - get the current time of the clock (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int clock_gettime    (    clockid_t         clock_id, /* clock ID (always CLOCK_REALTIME) */    struct timespec * tp        /* where to store current time */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the current value <i>tp</i> for the clock.<p></blockquote><h4>RETURNS</h4><blockquote><p>0 (OK), or -1 (ERROR) if <i>clock_id</i> is invalid or <i>tp</i> is NULL.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL, EFAULT</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./clockLib.html#top">clockLib</a></b><hr><a name="clock_settime"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>clock_settime</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>clock_settime</i>(&nbsp;)</strong> - set the clock to a specified time (POSIX)</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int clock_settime    (    clockid_t               clock_id, /* clock ID (always CLOCK_REALTIME) */    const struct timespec * tp        /* time to set */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the clock to the value <i>tp</i>, which should be a multipleof the clock resolution.  If <i>tp</i> is not a multiple of the resolution, itis truncated to the next smallest multiple of the resolution.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>0 (OK), or -1 (ERROR) if <i>clock_id</i> is invalid, <i>tp</i> is outside the supported range, or the <i>tp</i> nanosecond value is less than 0 or equal to or greater than1,000,000,000.<p></blockquote><h4>ERRNO</h4><blockquote><p>EINVAL<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./clockLib.html#top">clockLib</a></b>, <b><i><a href="./clockLib.html#clock_getres">clock_getres</a></i>(&nbsp;)</b></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -