[c/c++]在使用循环去查询消息等操作时加入Sleep()

/ 136评论 / 1476阅读 / 0点赞

加入比较短时间的Sleep()一般对时效性影响不大,但能极大地降低CPU占用。

#include<conio.h>
#include<iostream>
#include<windows.h>
using namespace std;

int main()
{
	cout << "<< 按任意键继续... ";
	for (int i = 0; _kbhit() == 0;)	//等待按键
	{
		switch (i++)	//选择打印最后的一个字符,使之有动画效果
		{
		case 0:cout << "\b/"; break;
		case 1:cout << "\b-"; break;
		case 2:cout << "\b\\"; break;
		case 3:
		{
			cout << "\b|";
			i = 0;
		}break;
		}
		//Sleep(100);    //暂停100毫秒(1秒 = 1000毫秒)
	}
}
  1. CharlesGib说道:

    5mg prednisone: prednisone oral – prednisone 2.5 mg daily

  2. MarvinMek说道:

    zithromax 500 mg for sale buy zithromax online fast shipping zithromax cost canada

  3. HenryIsona说道:

    average cost of generic zithromax: can you buy zithromax over the counter – where can i buy zithromax uk

  4. Billyeroge说道:

    http://prednisoned.online/# prednisone 5mg daily

  5. Richardfrota说道:

    prednisone 20mg by mail order: average cost of prednisone 20 mg – canada pharmacy prednisone

  6. MarvinMek说道:

    prednisone 50 mg price prednisone generic cost prednisone 20mg prices

  7. HenryIsona说道:

    buy doxycycline hyclate 100mg without a rx: doxycycline hyclate 100 mg cap – odering doxycycline

  8. Billyeroge说道:

    https://gabapentinneurontin.pro/# buying neurontin without a prescription

  9. HenryIsona说道:

    order doxycycline 100mg without prescription: where to purchase doxycycline – doxy 200

  10. CharlesGib说道:

    where can i buy neurontin from canada: neurontin tablets 300 mg – neurontin 150 mg

  11. Richardfrota说道:

    prednisone cream rx: where to buy prednisone uk – where can i get prednisone

  12. MarvinMek说道:

    10mg prednisone daily prednisone 50 mg buy prednisone brand name in usa

  13. Billyeroge说道:

    http://amoxila.pro/# buy amoxicillin canada

  14. HenryIsona说道:

    canada neurontin 100mg discount: neurontin cap – brand name neurontin

  15. CharlesGib说道:

    zithromax 250 mg pill: buy zithromax – where can i get zithromax

  16. Richardfrota说道:

    doxycycline 500mg: buy doxycycline online uk – doxycycline

  17. MarvinMek说道:

    10 mg prednisone prednisone 60 mg daily prednisone online australia

  18. Felipelam说道:

    https://pharmcanada.shop/# canadian pharmacy online store

  19. Williamfug说道:

    buy medication online no prescription: canadian prescription prices – mexican pharmacies no prescription

  20. DavidTaK说道:

    Online medicine order indian pharmacy online indian pharmacy online

  21. Jeromeviaph说道:

    http://pharmindia.online/# indianpharmacy com

  22. Felipelam说道:

    http://pharmworld.store/# canadian pharmacy no prescription

  23. Williamfug说道:

    indian pharmacy: best online pharmacy india – best india pharmacy

  24. DonaldtAg说道:

    top online pharmacy india: reputable indian online pharmacy – mail order pharmacy india

  25. DavidTaK说道:

    no prescription pharmacy paypal canadian pharmacy world coupon us pharmacy no prescription

  26. Donaldkenty说道:

    buying prescription medicine online: buying prescription medications online – pharmacy no prescription required

  27. Felipelam说道:

    http://pharmworld.store/# foreign pharmacy no prescription

  28. DavidTaK说道:

    legit canadian pharmacy canadian drugs pharmacy canadian drug pharmacy

  29. Felipelam说道:

    https://pharmworld.store/# cheapest prescription pharmacy

  30. Williamfug说道:

    india pharmacy: Online medicine home delivery – Online medicine home delivery

  31. DavidTaK说道:

    legitimate canadian pharmacy online canadian mail order pharmacy canadian pharmacy cheap

  32. DonaldtAg说道:

    pharmacy no prescription: no prescription online pharmacy – online pharmacy without a prescription

  33. Felipelam说道:

    https://pharmmexico.online/# medication from mexico pharmacy

  34. Williamfug说道:

    buying from online mexican pharmacy: mexican drugstore online – mexican pharmaceuticals online

  35. DavidTaK说道:

    canadian pharmacy service canadian drug stores canadian mail order pharmacy

  36. Felipelam说道:

    https://pharmindia.online/# india pharmacy mail order

回复 JustinTut 取消回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注