Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » yield_timeslice();

This thread is locked; no one can reply to it. rss feed Print
 1   2 
yield_timeslice();
orz
Member #565
August 2000

I believe that Sleep(1) is non-portable, so rest(1) would be the preferred method.

ReyBrujo
Moderator
January 2001
avatar

I think it is better if you work around the bug:

#if (ALLEGRO_SUB_VERSION < 1) && defined (ALLEGRO_WINDOWS)
    #define yield_timeslice() Sleep(1)
#endif

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Kitty Cat
Member #2,815
October 2002
avatar

yield_timeslice should be calling Sleep(0), not Sleep(1). Either way though, calling rest(0) should have the same effect as the old, proper yield_timeslice, while rest(1) has the same effect as the current version.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Cody Harris
Member #4,406
March 2004
avatar

I've used rest(1) in my loops before, and i've had great sucess with it...

---------------------------------
Homepage - Art (Photography)
I'm QBasicer on #allegro on Freenode.

Frank Drebin
Member #2,987
December 2002
avatar

anyone knows a good tool to monitor cpu usage (of seperated threads) for win9x ?
would be nice so that i see if my program has lag cause of missing cpu performcane or cause of bad network code.
:-)
btw where are the smileys gone?

gnolam
Member #2,030
March 2002
avatar

For just total CPU usage you can use the system monitor.

As for the smileys, the King of the Potato People has taken them. You'll have to fly to him on a magic carpet and plead with him to get them back.

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

 1   2 


Go to: