[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== CPU usage (OpenInsight 32-bit Specific) ====
=== At 28 MAY 2010 12:29:41PM Terry Rainville wrote: ===
{{tag>"OpenInsight 32-bit Specific"}}
In AREV3.111 we use TAME to remove the CPU usage by an idle machine.
In OI I am trying to make a similar thing.
I either would like to have a routine start a program on a regular basis.
OR
I have created a program that loops until a set amount of time, problem with this approach is the CPU is being eaten up, is there anyway to make this work better.
----
=== At 29 MAY 2010 05:13AM Eric wrote: ===
/* requires this DLL prototype entry in your record for DLL_KERNEL32
KERNEL32
ULONG STDCALL Sleep(ULONG) AS DONTASKTHEEMU
*/
In the editor, from the Exec box, enter the command
run declare_fcns "DLL_KERNEL32"
* Then in your program you can
DECLARE SUBROUTINE DONTASKTHEEMU
DONTASKTHEEMU(200)
* You may alter the value to suit your hardware.
* This sheds CPU load by returning timeslice control
* to Windows to process its own event queue (and other tasks,
* threads and events like keystrokes and screen refreshes
* and mouse moving).
Or else you can use YIELD() - see pg. 503 of the OI Programmer's reference manual.
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=915F341BD33BF0D585257731005A9BE6|View this thread on the forum...]]