腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(3316)
视频
沙龙
1
回答
std
::
this_thread
::
sleep_for
不存在
-
Windows10
g++
、
、
我目前正在运行一个在线(replit.com)执行得很好的测试程序,但当我在本地运行它时(在装有gcc和
g++
的
Windows10
上),我得到一个错误: test.cpp: In function 'int main()':
std
::
this_thread
::
sleep_for
<random&
浏览 146
提问于2021-11-13
得票数 0
回答已采纳
1
回答
分离调用未按预期工作
、
、
; cout<<"==== Endi
浏览 18
提问于2019-05-03
得票数 0
回答已采纳
1
回答
this_thread
/ chrono尚未声明
、
、
、
我有两个错误:.\main.cpp:12:14: error: '
std
::
this_thread
' has not been declared 12 |
std<
浏览 10
提问于2021-09-17
得票数 1
1
回答
错误:'
std
::
this_thread
‘尚未声明
、
、
、
、
我尝试使用
std
::
this_thread
::
sleep_for
()函数,但得到了错误SSCCE:
std
::
this_thread
::
sleep_for
(
std
::chrono::s
浏览 0
提问于2012-12-06
得票数 16
回答已采纳
1
回答
如何用MinGW编译C++
std
::thread代码?
、
、
、
、
::
this_thread
::
sleep_for
(
std
::chrono::seconds(1));{} {
std
::cout << "starting\n";
浏览 0
提问于2017-06-06
得票数 1
1
回答
为什么不需要将
this_thread
::
sleep_for
与线程连接起来?
、
、
、
通常,在GCC中构建与线程相关的代码时,必须明确链接到p线程:但是,下面的代码编译、链接和运行良好,而无需针对p线程进行链接:#include <thread>
std
::
this_thread
::
sleep_for
(1000ms);} 我猜这里发生的事
浏览 12
提问于2022-01-07
得票数 1
回答已采纳
1
回答
C++逐个字母输出
现在,我试过:
std
::cout << "H";
std
::cout << "e";
std
::cout << "l";
std
::
浏览 1
提问于2020-02-25
得票数 0
回答已采纳
2
回答
影响
std
::线程调用哪个虚拟成员函数的睡眠?
、
、
#include <iostream>using namespace
std
; public: virtual void a() { } B b;
this_thread
::
sleep_for
(chrono::seconds(1
浏览 0
提问于2018-04-20
得票数 8
回答已采纳
1
回答
sleep_for
产生缓冲效应
、
如果我将
sleep_for
注释掉,程序就会产生逗号和点,而
不存在
任何问题。但是,当我添加
sleep_for
时,它会挂一段时间,然后突然写出所有的逗号和点,在挂起的过程中,你会料到所有的逗号和点都会一蹴而就。(在Ubuntu20.04.4LTS上使用apt安装的
g++
11.2.0编译)#include <iostream>
std
::thread comm
浏览 3
提问于2022-04-06
得票数 0
回答已采纳
2
回答
代码生成- usleep vs
std
::
this_thread
::
sleep_for
、
我正在尝试评估usleep
std
::
this_thread
::
sleep_for
,并看到在使用
std
::
this_thread
::
sleep_for
与usleep时生成的更多指令。结果:{ usleep(30000); retu
浏览 0
提问于2018-03-03
得票数 3
回答已采纳
4
回答
std
::
this_thread
::
sleep_for
()和GCC
、
、
、
当我试图编译这个简单的程序时:
std
::
this_thread
::
sleep_for
(
std
::chrono::seconds(3));}
std
::thread t(f);}$
g++
-
std
=c++0x -pthreada.cpp -o aerror: ‘<
浏览 1
提问于2010-12-14
得票数 39
回答已采纳
2
回答
无法暂停与第三方库相关的线程
、
编译器是
g++
。#include <thread> {
std
::
this_thread
::
sleep_for
(duration);我用以下命令对其进行编译:好了,现在有了这个第三方库(来自AVT的
浏览 1
提问于2012-12-14
得票数 2
1
回答
在C++中是否存在通用睡眠和通用暂停命令?
、
、
、
我正在寻找一个通用的睡眠命令和一个通用的C++暂停命令。它需要在Windows、MAC和Linux计算机上工作。如果有人知道任何重要的可移植性命令,请告诉我。
浏览 9
提问于2014-10-21
得票数 1
回答已采纳
1
回答
cmd中的信息闪烁和更新非常快
我刚刚在c++写了我的第一个蛇游戏(恭喜我)。但有一个问题- cmd更新非常快,这就是为什么蛇移动得非常快,它只是不可能玩和吃水果
浏览 27
提问于2019-03-24
得票数 1
1
回答
OS X libstdc++防止boost::thread中断?
、
、
、
、
; boost::
this_thread
::
sleep_for
(boost::
sleep_for
(boost::chrono::milliseconds(3000));
std
::cout << "joinable: " << t.joinableboo
浏览 0
提问于2015-06-18
得票数 2
3
回答
std
::cout输出的时间是奇怪的。
、
、
、
#include <iostream>#include <chrono>{
std
::
this_thread
::
sleep_for
(
std
::chrono::milliseconds(1000) );
std
::cout <<
浏览 7
提问于2021-02-04
得票数 0
回答已采纳
3
回答
在c++中冻结输出屏幕一定时间
我一直在c++做一个蛇游戏。当蛇移动时,我希望蛇被冻结到它的位置1秒,然后打印新的位置。为此,我做了以下工作: time_t curr=time(NULL); while(1){ break; else{
浏览 9
提问于2017-02-01
得票数 1
回答已采纳
1
回答
C++中有等待功能吗?
、
、
#include <iostream> sleep(0.25);#include <windows.h> Sleep(250); cout
浏览 58
提问于2021-04-29
得票数 3
回答已采纳
1
回答
为什么一个线程的异常会停止整个进程?
、
::
this_thread
::
sleep_for
(
std
::chrono::seconds(5)); throw(
std
::string("exception"));{
std
::cout&l
浏览 0
提问于2018-03-19
得票数 1
回答已采纳
1
回答
在线程处于活动状态的同时生成线程并执行其他操作
、
、
() { return STATE;
std
::
this_thread
::
sleep_for
(
std
::chrono::seconds(1));
std
::
this_thread
::
sleep_for
(
std
::chrono::
浏览 12
提问于2019-11-14
得票数 0
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
热门
标签
更多标签
云服务器
ICP备案
对象存储
云直播
腾讯会议
活动推荐
运营活动
广告
关闭
领券