----boundary-LibPST-iamunique-1288617208_-_-
Content-type: text/plain
Hi:
there was an active discussion of this topic not long ago.
Doug Danforth posted a subsystem that uses Windows multimedia.
Getting down to 1 ms is tough. BlackBox is called from the Windows
event loop that limits the speed to tens of ms. There is a constant
in HostMenus (if I recall correctly). When you edit this, you can get
down to about 10 ms. Getting below 10 ms requires the multimedia timer,
and that is not part of BB. Let's see what Doug says, or e-mail him
directly.
Meanwhile, look at XYplane. It has the procedure ReadKey that
just reads the key from the keyboard. You can call it inside the
computation. Furthermore, since XYplane source is now available
in BB 1.5 Beta, you can see how to do such things.
W.
On Mon, 11 Jul 2005, Necati Ecevit wrote:
> Hello Blackbox users,
>
>
> Action.Do method is normally called at about 50 ms intervals if its body
> is empty (measured by PrivTestAction module as shown below) in Blackbox
> 1.5. Is it possible to decrease this dead time 1-3 ms?. i.e., I would
> like it to be called in 1-3 ms intervals.
>
> Alternatively, I can use the following technique;
> I have a long computation in a FOR loop. When the loop starts the
> framework is locked until it is finished. If I would like to to stop
> computation by pressing a command or command button how this can be
> achieved.
> (In Delphi, there was an Application.ProcessMessages procedure, when
> this procedure is called in a loop I could use the buttons to exit from
> the loop, that increases the computation time also)
>
> Thanks for help,
>
> - Necati
>
> (******************)
> MODULE PrivTestAction;
>
>
> IMPORT Out, Services;
>
> TYPE
> Action = POINTER TO RECORD (Services.Action) END;
>
> VAR i: INTEGER;
>
> action: Action;
> actionalive: BOOLEAN;
> dt0, time: LONGINT;
>
> PROCEDURE (a: Action) Do;
> BEGIN
> IF actionalive THEN
> time := Services.Ticks() - dt0;
> Services.DoLater(action, Services.now);
> dt0 := Services.Ticks();
> END;
> END Do;
>
>
> PROCEDURE Start*;
> BEGIN
> actionalive := TRUE;
> Out.String('Started'); Out.Ln;
> Services.DoLater(action, Services.now);
> dt0 := 0;
> END Start;
>
> PROCEDURE Stop*;
> BEGIN
> actionalive := FALSE;
> Out.String('time (ms): '); Out.Int(time, 0); Out.Ln;
> END Stop;
>
> BEGIN
>
> NEW(action);
> actionalive := FALSE;
>
> END PrivTestAction.
>
> PrivTestAction.Start
>
> PrivTestAction.Stop
>
> (* time: 50 - 55 ms *)
>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy>
>
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
----boundary-LibPST-iamunique-1288617208_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEhpOlxwYXINClxwYXINCiAgdGhlcmUgd2FzIGFu
IGFjdGl2ZSBkaXNjdXNzaW9uIG9mIHRoaXMgdG9waWMgbm90IGxvbmcgYWdvLlxwYXINCkRvdWcg
RGFuZm9ydGggcG9zdGVkIGEgc3Vic3lzdGVtIHRoYXQgdXNlcyBXaW5kb3dzIG11bHRpbWVkaWEu
XHBhcg0KR2V0dGluZyBkb3duIHRvIDEgbXMgaXMgdG91Z2guIEJsYWNrQm94IGlzIGNhbGxlZCBm
cm9tIHRoZSBXaW5kb3dzXHBhcg0KZXZlbnQgbG9vcCB0aGF0IGxpbWl0cyB0aGUgc3BlZWQgdG8g
dGVucyBvZiBtcy4gVGhlcmUgaXMgYSBjb25zdGFudFxwYXINCmluIEhvc3RNZW51cyAoaWYgSSBy
ZWNhbGwgY29ycmVjdGx5KS4gV2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