Is there a way to get a shorter sleep time than 1? I know that its 1/10th of a second, but its too slow for what I'm trying to do.
I have a HUD text display that shows up when you talk to NPCS or when an event is triggered but they take a lot of time to talk, especially during a fast paced thing (Like someone screaming in fear then running). I suppose I could make it sleep only every X letters that show up but it wouldn't look as good as it does when every letter appears by itself.
Any help with this would be great.
ID:164958
![]() Mar 20 2007, 11:52 am
|
|
![]() Mar 20 2007, 11:53 am
|
|
I usually do if(prob(25)) sleep(1)
|
You could just use the modulus operator.
mob |
THats true but the prob() way is (technically) the same effect and using that would take more integrating that I need to deal with with using prob() instead anyway. THanks.
|
sleep() with no arguments at all will only pause for a moment when the server is stressed.
|
Yeah but then it's like not having it anyway. I believe a sleep() is like a millisecond or something.
|
I don't think it would be possibl for decimal values. Correct me if I'm wrong, but I believe sleep() works with the 10 FPS system on BYOND, and allowing decimals just simply would not work. I mean, why else would we be limited to 10 FPS? My guess is the 10 tick system.
|
Not really. It makes a very big difference on some loops. If your loop is CPU-intensive, BYOND might pick up an infinite loop runtime and cancel it or something. Using a sleep() procedure with no arguments will actually wait for the host's PC to slow down a second so that DS does not crash.
|
Polantaris, may I talk to you in e-mail? Got a few questions to ask regarding Slime Journey. (mine is [email protected])
Umm, about sleep. obj |
Polantaris wrote:
THats true but the prob() way is (technically) the same effect Uh, no it isn't. If you're relying on random integers than you are also relying on random waiting times. sleep()ing at random would probably result in random waiting times, and I don't suppose you'd want to rely on luck to operate your system. In theory, though, DM may base its randomness upon a counter of some sort, and thus would result in constant waiting times. I'm not too sure about that, though. You probably won't get the quarter you're attempting to achieve here even if it was constant, as time would probably be counted differently (thus resulting in an eighth or a half, or a second, or something of the sort). |