TIP: Click on subject to list as thread! ANSI
echo: pascal_lessons
to: Jasen Betts
from: mark lewis
date: 2003-12-14 20:53:14
subject: since ya`ll are asking.

CH>> For A := 0 to 100 do
 CH>>     begin
 CH>>      {Do some stuff here}
 CH>>      TimeSlice;
 CH>>     end;

 CH>> It would do 100 timeslices back to back.

 JB> first off check the documentation for "timeslice"  I don't
 JB> find it documented as a standard part of TP

it is most likely a custom procedure... i call mine "killtime"...

 JB> What I'm guessing it does is inform a multitasker that the
 JB> program is not busy so that the multitasker can dedicate
 JB> more cpu effort to running other tasks.  (AFAIK windows
 JB> OS/2 and Dessqview all do that in slightly different ways
 JB> (if you're using a dos compiler)

all true... in my previous message, i noted 5 seperate slicers that i
use... of those, there are 4 distinctly seperate ones...

 CH>> I have read that you should time them to be at least 55 ms
 CH>> apart ( depending on the system ).  That if you do like I
 CH>> did above it will accually make the application use more
 CH>> of the CPU.

 JB> I don't see how it could cause more CPU usage than putting
 JB> some form of delay loop between calls to timeslice.

me either... and to do that properly would mean chaining the timer
interrupt and counting... that's not that hard to do, though... i have
stuff here that i use in some debugging and routine timing stuff that sets
the clock timer interrupt to fire off 1000 times a second instead of the
default 18.2 times a second... yeah, one has to make sure that they call
the original clock vector every 18.2 times a second or the system clock
will run ahead quite quickly...

 CH>> Maybe someone could explain to me all about Time Slices.  Or
 CH>> point me in the direction of a place I can read up on them.

 JB> OTOH if you want to delay for a long time there may be some
 JB> sort of sleep procedure avaialable. (but your code suggests
 JB> to me that you want to "do some stuff" between timeslices so
 JB> probably you are doing it the best way.

yes, to me, it, too, appears that he is wanting to make his stuff more
multitasker friendly...

)\/(ark

* Origin: (1:3634/12)
SEEN-BY: 633/267 270
@PATH: 3634/12 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.