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

/ 4,290评论 / 18746阅读 / 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. Сервисный центр предлагает отремонтировать кондиционера energolux срочный ремонт кондиционера energolux

  2. Hokicoy Gacor说道:

    When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and now every
    time a comment is added I receive 4 emails with the same comment.
    Is there a way you can remove me from that service? Cheers!

  3. Mallie Toms说道:

    I blog quite often and I seriously appreciate your information. This great article has truly peaked my interest. I will take a note of your blog and keep checking for new information about once a week. I opted in for your Feed too.

  4. ErnestLom说道:

    pin up 306: pin-up casino giris – pin up

  5. Если вы искали где отремонтировать сломаную технику, обратите внимание – ремонт цифровой техники екб

  6. ufo5555说道:

    When someone writes an article he/she retains the image of a
    user in his/her mind that how a user can be aware
    of it. Thus that’s why this article is outstdanding.
    Thanks!

  7. Russellsex说道:

    пинап зеркало: пин ап – пинап зеркало

  8. DavidBeiff说道:

    http://1winbrasil.win/# pinup az
    пинап казино

  9. Edwardclozy说道:

    pin-up: pin-up – pin up azerbaycan

  10. ErnestLom说道:

    1хставка: 1хставка – 1xbet

  11. ufoo555说道:

    It’s hard to come by experienced people in this particular
    topic, but you sound like you know what you’re talking about!
    Thanks

  12. DavidBeiff说道:

    http://1winindia.tech/# пин ап
    пин ап казино вход

  13. ufoo555说道:

    Hello Dear, are you genuinely visiting this site regularly, if
    so after that you will absolutely take nice experience.

  14. Slot BPD说道:

    I’m really enjoying the theme/design of your site.

    Do you ever run into any browser compatibility issues? A handful of my blog visitors have complained about my website not
    working correctly in Explorer but looks great in Chrome.
    Do you have any recommendations to help fix this problem?

  15. Edwardclozy说道:

    пинап зеркало: пин ап вход – пин ап зеркало

  16. Russellsex说道:

    пинап: пинап – пин ап

  17. slot bank bpd说道:

    This website definitely has all the info I needed about this subject and
    didn’t know who to ask.

  18. ufo5555说道:

    Very shortly this website will be famous amid all blogging and site-building people, due to it’s
    pleasant content

  19. DavidBeiff说道:

    https://1winindia.tech/# пинап кз
    пинап

  20. ErnestLom说道:

    1xbet официальный сайт: 1хбет – 1хбет

  21. Jamesesown说道:

    pin-up casino giris pin-up casino giris pin-up

  22. DavidBeiff说道:

    https://1winrussia.online/# 1хбет
    пин ап казино вход

  23. 슬롯사이트说道:

    You’re so cool! I do not think I’ve read something like that before. So nice to find another person with a few unique thoughts on this subject matter. Really.. thank you for starting this up. This website is something that’s needed on the internet, someone with some originality.

  24. Russellsex说道:

    pin up azerbaycan: pin up – pin up 306

  25. Edwardclozy说道:

    пин ап казино вход: пинап кз – pin up kz

  26. 飛鳥 会说道:

    Multiple Weapons – sp00ge!

  27. You will get this Armani product for as little as £37.50 for the 75 ml bottle.

  28. winning303说道:

    This is really attention-grabbing, You are an excessively skilled blogger.

    I’ve joined your feed and sit up for looking for extra of your magnificent post.
    Also, I have shared your site in my social networks

  29. 投資家 爆说道:

    131 which killed 20,000 people.

  30. ufo5555说道:

    Fabulous, what a webpage it is! This weblog provides
    valuable information to us, keep it up.

  31. Hokicoy login说道:

    We’re a group of volunteers and starting a new scheme in our community.
    Your web site offered us with valuable information to work on. You
    have done an impressive activity and our whole neighborhood will be grateful to you.

  32. ErnestLom说道:

    1хбет: 1xbet скачать – 1xbet официальный сайт

  33. Margene Stenback说道:

    I blog quite often and I seriously appreciate your information. This great article has truly peaked my interest. I will take a note of your blog and keep checking for new information about once a week. I opted in for your Feed too.

  34. Jamesesown说道:

    canl? casino siteleri guvenilir casino siteleri casino oyunlar?

  35. Hokicoy Daftar说道:

    I have learn some excellent stuff here. Definitely worth bookmarking for revisiting.
    I wonder how much effort you put to create this sort of excellent informative web site.

  36. Edwardclozy说道:

    пин ап: пин ап официальный сайт – пин ап вход

  37. Russellsex说道:

    pinup az: pinup az – pin up

  38. winning303说道:

    Wow, this post is fastidious, my sister is analyzing
    these things, thus I am going to tell her.

  39. ErnestLom说道:

    1xbet официальный сайт: 1xbet скачать – 1хставка

  40. Russellsex说道:

    canl? casino siteleri: canl? casino siteleri – en iyi casino siteleri

  41. Slot BPD说道:

    Hmm it looks like your site ate my first comment (it was super long) so I guess I’ll just sum
    it up what I wrote and say, I’m thoroughly enjoying your blog.
    I too am an aspiring blog writer but I’m still new to everything.

    Do you have any points for novice blog writers? I’d certainly appreciate it.

  42. ufoo555说道:

    Great post however , I was wondering if you could write a litte more on this topic?
    I’d be very grateful if you could elaborate a little bit further.
    Many thanks!

  43. Judging from the naming and placement within the arts record, this was an Artwork meant for Ancient Daedala.

  44. On August 26, not less than two individuals who tested constructive reported attending the Sturgis Motorbike Rally, amongst different potential exposures.

  45. Edwardclozy说道:

    пин ап официальный сайт: пин ап официальный сайт – пин ап зеркало

  46. When medical procedures that have been in any other case deemed serious are delayed for too long, other well being points surface.

  47. Stan Camilleri说道:

    I blog quite often and I seriously appreciate your information. This great article has truly peaked my interest. I will take a note of your blog and keep checking for new information about once a week. I opted in for your Feed too.

  48. Edwardclozy说道:

    pinup az: pin up 306 – pin-up

  49. DavidBeiff说道:

    https://1winci.icu/# пин ап официальный сайт
    пин ап казино

  50. Hokicoy Gacor说道:

    hi!,I really like your writing so so much! proportion we keep up a correspondence
    more about your article on AOL? I need an expert on this space to unravel my problem.
    May be that’s you! Looking ahead to peer you.

发表回复

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