腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
搜索
关闭
文章
问答
(1182)
视频
开发者手册
清单
用户
专栏
沙龙
全部问答
原创问答
Stack Exchange问答
更多筛选
回答情况:
全部
有回答
回答已采纳
提问时间:
不限
一周内
一月内
三月内
一年内
问题标签:
未找到与 相关的标签
筛选
重置
1
回答
比较
timespec
值
比较两个
timespec
值的最佳方式是什么,以查看哪个先发生? //Returns true if b happened first -- b will be "lower".
浏览 1
修改于2015-06-17
得票数 5
1
回答
Timespec
重定义错误
在使用Visual 2015在C中执行P线程程序时,我得到了以下错误:以下是我的代码:{ printf("x=%d", x);pthread.h头文件包含以下与
timespec
defined(HAVE_STRUCT_
TIMESPEC</
浏览 3
修改于2016-05-06
得票数 22
2
回答
timespec
的存储大小未知
对于一个类,我们不得不切换到c99编译器而不是gnu,但现在
timespec
似乎被打破了。除了“
timespec
的存储大小未知”,我还收到了一堆其他错误,如"CLOCK_MONOTONIC未声明“、”取消引用指向不完整类型'struct
timespec
‘的指针“,以及未使用的变量警告,但我认为一旦我解决了编译器问题我不认为我声明
timespec
变量的方式有什么问题, struct
timespec
startTime;
浏览 17
修改于2017-05-23
得票数 3
1
回答
C: struct
timespec
c库
我正在尝试编写一个较小的库,使我能够度量使用struct
timespec
时测量的平均时间。因为C不允许操作符重载,所以我不得不构建函数。get_
timespec
_diff(const struct
timespec
t1, const struct
timespec
t2) struct
timespec
t;
timespec
_add(const struct
timespec
t1, const struct
timespec
t2)
浏览 0
提问于2020-11-27
得票数 3
3
回答
C时间vs
timespec
除了精度上的不同,struct timeval和struct
timespec
还有什么不同?如果我需要比µs更低的精度(比如毫秒),为什么我要使用一个而不是另一个呢?This is like a `struct timeval' butstruct
timespec
浏览 0
提问于2015-07-08
得票数 15
回答已采纳
2
回答
windows的
timespec
等效项
之前我使用的是
timespec
结构,但windows中没有这样的东西。命令GetTickCount还不够,因为它返回以毫秒为单位的时间。我也在考虑QueryPerformanceFrequency。有没有人碰巧知道一些尽可能与
timespec
相同的东西? 将来,我甚至可能还需要纳秒,这是我在windows中搜索过的都不支持的。
浏览 2
修改于2018-11-08
得票数 6
回答已采纳
5
回答
格式化struct
timespec
如何将struct
timespec
格式化为字符串?这个结构是由clock_gettime()返回的,例如在Linux端的gcc: time_t tv_sec; /* seconds */
浏览 3
修改于2011-11-29
得票数 34
回答已采纳
2
回答
Linux内核事件: timeval或
timespec
我想记录这些事件的时间,但我不知道这些事件是以
timespec
还是timeval的形式传递的。有人能指出我的正确方向吗?
浏览 4
修改于2019-07-23
得票数 1
回答已采纳
5
回答
Visual错误--带有
timespec
结构
在使用Visual 2015在C中执行P线程程序时,我得到了以下错误:以下是我的代码: #include<pthread.h>
浏览 1
修改于2021-02-11
得票数 9
回答已采纳
3
回答
Windows中是否没有定义
timespec
?
我已经包含了time.h和ctime,但是vc9仍然抱怨一个未定义的类型'
timespec
‘。我搜索了这里、MSDN和web (即使有确切的编译器错误),但我找不到答案……也许它只是迷失在嘈杂声中。下面是确切的错误:谢谢
浏览 1
修改于2018-07-13
得票数 2
1
回答
C内核--如何使用
timespec
_to_ns()?
我需要给出const struct
timespec
*的论点,但是start_time是struct
timespec
类型的。(*kinfo).start_time =
timespec
_to_ns((*current).start_time);
浏览 5
修改于2015-09-18
得票数 2
回答已采纳
1
回答
从unix
timespec
转换为NTP
我需要从unix
timespec
转换到NTP时间戳:纪元,从纪元开始的秒,秒的分数。这是我的代码。你觉得这样可以吗?void unix_ns_2ntp(struct ntp_time *ntp, const struct
timespec
*ts) uint64_t era_and_offset = ((
浏览 4
修改于2015-04-22
得票数 1
5
回答
未在time.h中找到
timespec
/src/TTNoddy.c:16:2: error: unknown type name ‘
timespec
’#include <time.h> TS.tv_nsec = 1; } 我对此感到困惑--我是一名C++程序员,一生中从未编写过纯C语言的应用程序,但clock_gettime的手册页清楚地表明,
timespec
位于我在这里包含的time.h头文件中。
浏览 3
修改于2021-02-04
得票数 18
回答已采纳
3
回答
将GNU端口的毫秒转换为
timespec
我希望将毫秒转换为GNU Linux所使用的
timespec
结构。我也尝试过遵循相同的代码。
timespec
GetTimeSpecValue(unsigned long milisec) struct
timespec
req; //long sec = (milisecondtime
浏览 13
修改于2019-05-27
得票数 8
回答已采纳
2
回答
windows编译器上的
timespec
在posix上,可以使用
timespec
计算准确的时间长度(如秒和毫秒)。不幸的是,我需要使用Visual Studio编译器迁移到windows。VS time.h库没有声明
timespec
,所以我正在寻找其他选项。就我所能搜索到的,使用clock和time_t是可能的,尽管我不能检查时钟计数的毫秒数有多精确。
浏览 2
修改于2011-05-31
得票数 2
回答已采纳
1
回答
用Python将
timespec
转换为YYYYMMDD
我正在使用获取创建文件的日期。 datetime.datetime.fromtimestamp(statinfo.st_birthtime)
浏览 3
修改于2020-06-20
得票数 0
回答已采纳
1
回答
如何正确地将
timespec
转换为timeval?
我有一个struct
timespec
对象,我需要将其转换为struct timeval,以便与lutimes(...)一起使用。struct timeval tv;现在,来自EINVAL的lutimes意味着u
浏览 4
修改于2018-02-08
得票数 0
回答已采纳
1
回答
如何正确地添加
timespec
变量
我知道
timespec
的tv_sec只包含整数。所以,如果我需要等待1.5秒或0.1秒,我就在挣扎着该怎么做。下面是我为它编写的代码: clock_gettime(CLOCK_REALTIME, &timeToWait);
浏览 2
提问于2022-04-08
得票数 0
回答已采纳
2
回答
clock_nanosleep():它忽略
timespec
结构
int s = 1; t.tv_sec = s; int clock_nanosleep(clockid_t clock_id, int flags, const struct <
浏览 6
提问于2021-01-19
得票数 0
回答已采纳
2
回答
在哪里可以找到
timespec
_get的源代码?
如果我在cp首选项上或在我的计算机上运行示例代码,它可以工作:#include <time.h> {
timespec
_get(&ts, TIME_UTC); strftime(buff, sizeof buff, "%D %T", gmtime(struct
timespec
*ts, int base) s
浏览 2
提问于2018-07-24
得票数 2
回答已采纳
第 2 页
第 3 页
第 4 页
第 5 页
第 6 页
第 7 页
第 8 页
第 9 页
第 10 页
第 11 页
点击加载更多
领券