ID:269920
Nov 15 2005, 3:49 pm
|
|
what number needs to go in sleep(##) for it to sleep for 1 second?
|
Nov 15 2005, 3:53 pm
|
|
Sleep(n) sleeps for n milliseconds. 10 milliseconds = 1 second.
|
In response to Jp
|
|
Nope, there are 1000 milliseconds per second. =)
BYOND's sleeps are measured in "ticks", and ideally, every tick is one decisecond, which is one tenth of a second. However, CPU load can make a tick last longer than 1/10 s -- sometimes a single tick can last several real seconds if your world is lagging badly (usually from a needlessly big and badly-designed loop...). You might also find this snippet handy: //Title: Time Preprocessor Macros Obviously there's a lot of baggage there. The meat and potatoes is the <font color="green">#define</font> lines. The rest is just explanatory text and unit testing code. |
In response to Jtgibson
|
|
Oops, not thinking. Thank you, spuzbson.
|
In response to Jtgibson
|
|
ty much
|