Board index » delphi » how to write delay procedure which will delay const short period under Win95
?à¥?μ?
![]() Delphi Developer |
Mon, 03 May 1999 03:00:00 GMT
|
?à¥?μ?
![]() Delphi Developer |
Mon, 03 May 1999 03:00:00 GMT
how to write delay procedure which will delay const short period under Win95Hi folks, I am writing a program to sample some data from I/O ports, therefore,I But beecaue I am running the program under win95, I find that the delay My problem is that is it possible to write a delay function that will Any help is appriciated!! Y.S. Huang procedure Delay |
?à¥?μ
![]() Delphi Developer |
Mon, 03 May 1999 03:00:00 GMT
Re:how to write delay procedure which will delay const short period under Win95Quote??? wrote: y...@pidc.gov.tw |
DSpa..
![]() Delphi Developer |
Tue, 04 May 1999 03:00:00 GMT
Re:how to write delay procedure which will delay const short period under Win95Quote??? wrote: |
steffen guertl
![]() Delphi Developer |
Tue, 04 May 1999 03:00:00 GMT
Re:how to write delay procedure which will delay const short period under Win95In <328ACB51.2...@pidc.gov.tw>, ??? <y...@pidc.gov.tw> writes: Quote>Hi folks, Your problem seems to be quite similar to the mine. It seems you need a delay for a very short time (nop at a pentium 100 needs 1 clock=10ns -> your loop needs about 10 microseconds). Probably the task switches of windows make your loop much longer but not constant at all. One way (not the best) is to fix the speed of the loop with the i/o-clock, this means 8MHz if you call an address corresponding to the ISA-bus or 33MHz for an address of the PCI-bus. Your loop could be: asm mov dx,$378 mov cx, Time @M1: in al,dx out dx,al loop @M1 end; It works not perfectly, but better than nops. If your update interval is bigger than 2ms than you may write a timer-interrupt procedure, which is definitively more precise than sleep(2). I have another idea, but perhaps you may try the above before, and contact me by e-mail or this news-group. Regards, |
GUILHERME LOUREI
![]() Delphi Developer |
Sat, 08 May 1999 03:00:00 GMT
Re:how to write delay procedure which will delay const short period under Win95A+n+a+, (is this your name ?) i >I am writing a program to sample some data from I/O ports, therefore,I Well, if I were you I would use Window's API help to do that. I mean, I hope this helps you and you don't get angry with my poor english. Inte, |