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

/ 257评论 / 1710阅读 / 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. Williamfug说道:

    prescription drugs canada buy online: reputable canadian online pharmacy – pharmacy wholesalers canada

  2. DavidTaK说道:

    buying prescription drugs in mexico medication from mexico pharmacy reputable mexican pharmacies online

  3. Donaldkenty说道:

    canadian neighbor pharmacy: canadian pharmacies comparison – canadian drug

  4. DonaldtAg说道:

    rx pharmacy no prescription: cheap pharmacy no prescription – online canadian pharmacy coupon

  5. Jeromeviaph说道:

    http://pharmmexico.online/# mexican online pharmacies prescription drugs

  6. Elmersoalf说道:

    Viagra online price Buy Viagra online order viagra

  7. Jamesexite说道:

    Sildenafil 100mg price: buy viagra here – Viagra generic over the counter

  8. Georgefrege说道:

    Cialis 20mg price: Generic Tadalafil 20mg price – Cheap Cialis

  9. Charlesvox说道:

    http://viagras.online/# Viagra tablet online

  10. Elmersoalf说道:

    Buy Levitra 20mg online Buy Vardenafil 20mg Buy Vardenafil 20mg online

  11. Esenistracupt说道:

    Циклёвка паркета: особенности и этапы услуги
    Циклёвка паркета — это процесс восстановления внешнего вида паркетного пола путём удаления верхнего повреждённого слоя и возвращения ему первоначального вида. Услуга включает в себя несколько этапов:
    Подготовка: перед началом работы необходимо защитить мебель и другие предметы от пыли и грязи, а также удалить плинтусы.
    Шлифовка: с помощью шлифовальной машины удаляется старый лак и верхний повреждённый слой древесины.
    Шпатлёвка: после шлифовки поверхность паркета шпатлюется для заполнения трещин и выравнивания поверхности.
    Грунтовка: перед нанесением лака паркет грунтуется для улучшения адгезии и защиты от плесени и грибка.
    Нанесение лака: лак наносится в несколько слоёв с промежуточной шлифовкой между ними.
    Полировка: после нанесения последнего слоя лака паркет полируется для придания поверхности блеска и гладкости.
    Циклёвка паркета позволяет обновить внешний вид пола, восстановить его структуру и продлить срок службы.
    Сайт: ykladka-parketa.ru
    Циклевка паркета

  12. Jamesexite说道:

    Levitra 20 mg for sale: Vardenafil online prescription – Buy generic Levitra online

  13. Elmersoalf说道:

    Kamagra 100mg price kamagra.win sildenafil oral jelly 100mg kamagra

  14. Charlesvox说道:

    http://levitrav.store/# Buy Vardenafil 20mg

  15. Jamesexite说道:

    Tadalafil Tablet: Generic Cialis without a doctor prescription – Cialis over the counter

  16. DavidBiolo说道:

    http://cialist.pro/# Cialis 20mg price

  17. Elmersoalf说道:

    Buy Levitra 20mg online buy Levitra over the counter Vardenafil online prescription

  18. Charlesvox说道:

    http://kamagra.win/# buy Kamagra

  19. Tylerreunk说道:

    http://levitrav.store/# Buy Vardenafil 20mg

  20. Jamesexite说道:

    buy cenforce: cenforce for sale – order cenforce

  21. Georgefrege说道:

    Cheap Levitra online: Levitra generic price – Levitra 10 mg buy online

  22. Elmersoalf说道:

    Order Viagra 50 mg online Cheapest place to buy Viagra Sildenafil Citrate Tablets 100mg

  23. Charlesvox说道:

    http://levitrav.store/# Generic Levitra 20mg

  24. Jamesexite说道:

    buy cialis pill: Cialis 20mg price in USA – Cialis without a doctor prescription

  25. Elmersoalf说道:

    Viagra online price Buy Viagra online cheap cheap viagra

  26. DavidBiolo说道:

    https://cialist.pro/# cialis for sale

  27. Charlesvox说道:

    https://cialist.pro/# Cialis without a doctor prescription

  28. Jamesexite说道:

    Kamagra 100mg price: kamagra pills – Kamagra Oral Jelly

  29. Georgefrege说道:

    order viagra: cheapest viagra – Cheap generic Viagra online

  30. RandallGuesE说道:

    buy lisinopril 2.5 mg online: where to buy lisinopril online – zestril cost price

  31. WilliamRen说道:

    http://lisinopril.network/# zestril 10 mg online

  32. Davidfrify说道:

    cipro ciprofloxacin ciprofloxacin ciprofloxacin 500mg buy online

  33. RonaldSwobe说道:

    https://lisinopril.network/# buy lisinopril canada

  34. RandallGuesE说道:

    buy cheap propecia online: get generic propecia pills – cost of cheap propecia without dr prescription

  35. Davidfrify说道:

    tamoxifen medication tamoxifen joint pain tamoxifen alternatives premenopausal

  36. Davidfrify说道:

    nolvadex steroids tamoxifen buy nolvadex d

  37. RandallGuesE说道:

    Cytotec 200mcg price: cytotec pills buy online – purchase cytotec

  38. WilliamRen说道:

    https://finasteride.store/# get generic propecia pill

  39. Davidfrify说道:

    tamoxifen joint pain tamoxifen citrate pct cost of tamoxifen

  40. RandallGuesE说道:

    cipro 500mg best prices: buy generic ciprofloxacin – cipro pharmacy

  41. WilliamRen说道:

    http://cytotec.club/# Cytotec 200mcg price

  42. RonaldSwobe说道:

    http://lisinopril.network/# lisinopril 2.5 mg coupon

  43. Davidfrify说道:

    lisinopril brand name uk lisinopril 25 mg price how much is lisinopril

  44. WilliamRen说道:

    https://ciprofloxacin.tech/# antibiotics cipro

  45. RandallGuesE说道:

    lisinopril tabs 20mg: lisinopril 60 mg – 1 lisinopril

  46. Davidfrify说道:

    propecia cost generic propecia without prescription cost of cheap propecia without rx

  47. WilliamRen说道:

    http://nolvadex.life/# femara vs tamoxifen

  48. RandallGuesE说道:

    cost for 40 mg lisinopril: lisinopril 250 mg – lisinopril 40 mg for sale

  49. Davidfrify说道:

    get cheap propecia tablets buy cheap propecia no prescription cost of propecia prices

发表回复

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