<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[clock_gettime 是 POSIX 标准推荐的高精度时间获取函数，编译不过 。]]></title><description><![CDATA[<p dir="auto">clock_gettime 是 POSIX 标准推荐的高精度时间获取函数，编译不过 。<br />
#include &lt;time.h&gt;</p>
<p dir="auto">struct timespec {<br />
time_t tv_sec;  /* 秒 <em>/<br />
long   tv_nsec; /</em> 纳秒，取值范围 0 ~ 999999999 */<br />
};<br />
int clock_gettime(clockid_t clk_id, struct timespec *tp);</p>
<p dir="auto">代码中宏已打开<br />
#define _GNU_SOURCE</p>
<p dir="auto"><img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1686/1b680dfc-8228-41ac-a90c-449889dcc6a8.png" alt="eaffcff2-a79c-4acc-81c0-92662c87c6b1-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="https://yt-static-main.oss-cn-shanghai.aliyuncs.com/nodebb/1686/93a135b0-d2fd-48a3-96b7-005e21bebc57.png" alt="792b3541-4ef4-429f-a96b-b1bb34aa18be-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.ytmicro.com/topic/2065/clock_gettime-是-posix-标准推荐的高精度时间获取函数-编译不过</link><generator>RSS for Node</generator><lastBuildDate>Thu, 25 Jun 2026 19:08:54 GMT</lastBuildDate><atom:link href="https://forum.ytmicro.com/topic/2065.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Jun 2026 01:19:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to clock_gettime 是 POSIX 标准推荐的高精度时间获取函数，编译不过 。 on Thu, 25 Jun 2026 02:37:55 GMT]]></title><description><![CDATA[<p dir="auto">us级可以用ptmr通道获取时间戳做差</p>
]]></description><link>https://forum.ytmicro.com/post/8944</link><guid isPermaLink="true">https://forum.ytmicro.com/post/8944</guid><dc:creator><![CDATA[swust]]></dc:creator><pubDate>Thu, 25 Jun 2026 02:37:55 GMT</pubDate></item><item><title><![CDATA[Reply to clock_gettime 是 POSIX 标准推荐的高精度时间获取函数，编译不过 。 on Thu, 25 Jun 2026 02:19:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.ytmicro.com/uid/1">Frankie</a>  想获取某段代码执行的时间，有能用的时间函数推荐吗？毫秒或者微妙级的。<br />
gettimeofday()也无法使用 。<br />
failed: Function not implemented<br />
报这个错，云途环境不支持</p>
]]></description><link>https://forum.ytmicro.com/post/8943</link><guid isPermaLink="true">https://forum.ytmicro.com/post/8943</guid><dc:creator><![CDATA[lipeng2026]]></dc:creator><pubDate>Thu, 25 Jun 2026 02:19:23 GMT</pubDate></item><item><title><![CDATA[Reply to clock_gettime 是 POSIX 标准推荐的高精度时间获取函数，编译不过 。 on Thu, 25 Jun 2026 01:51:09 GMT]]></title><description><![CDATA[<p dir="auto">编译不报错也没有意义啊</p>
]]></description><link>https://forum.ytmicro.com/post/8940</link><guid isPermaLink="true">https://forum.ytmicro.com/post/8940</guid><dc:creator><![CDATA[Frankie]]></dc:creator><pubDate>Thu, 25 Jun 2026 01:51:09 GMT</pubDate></item></channel></rss>