Page 2 of 2 <12
Topic Options
#84960 - 2002-02-05 09:09 PM Re: How do I throttle back the CPU on a script?
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
NTDOC,
You want to implement the possibility to dynamically call an API command ?
_________________________
? getobject(Kixtart.org.Signature)

Top
#84961 - 2002-02-06 01:15 AM Re: How do I throttle back the CPU on a script?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Hi Alex,

Not necessarily to call just any DLL... that would probably be difficult as well as raise the size of the executable significantly. I was thinking though that instead of the KIX32.EXE or WKIX32.EXE file intrinsically containing the code to perform sleep or wait states, Ruud could easily (and without increasing size too much, I would think) call the KERNEL32.DLL,SLEEP function that is built in already and available on all systems.

Top
#84962 - 2002-02-06 01:32 AM Re: How do I throttle back the CPU on a script?
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
NTDOC,
Ruud will confirm or infirm this, but for me he is using the sleep api command, and not a build-in one. It's much better as it already exist, and so take very little code.
A little upper, I said that Ruud should use it like this (more explained):
sleep(dwMilliseconds * 1000)
With dwMilliseconds the value in the KiXtart script. So you only start with seconds.

Seems Ruud made a choice about this, thinking that it won't be necessary to have a sleep lower than 1 sec, but only time can say if it's good or not.

_________________________
? getobject(Kixtart.org.Signature)

Top
#84963 - 2002-03-21 10:38 PM Re: How do I throttle back the CPU on a script?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Good morning cj ,

think the Question is answered :

code:
;somewhere in the beginning :


if @kix >= '4.10' $ms = 1 endif

;in yer loop


...
if $ms sleep 0.001 endif
...

J. [Big Grin]

p.s. : I didn't find any way yet to execute() the new and improved sleep command [Frown]
(bad news for enthusiastic KiX-games writers)

[ 21 March 2002, 22:40: Message edited by: jpols ]
_________________________



Top
Page 2 of 2 <12


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1376 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.049 seconds in which 0.033 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org