[fpc-pascal] Microsecond Delay Suggestions?
James Richters
james at productionautomation.net
Tue Jul 26 21:52:36 CEST 2016
>An alternative would be NtDelayExecution from unit jwanative. Its interval
argument is in multiples of 100ns
>and is essentially what Windows' Sleep() uses internally.
>Note: The first argument "Alertable" determines whether the function can be
interrupted by NtAlertThread
>(and whatever Windows API functions use that internally).
This sounds like it would work, but I can't figure out how to use it. Do
you have an example?
I've tried just a quick test like this:
uses
windows,jwanative;
Var
DelayInterval : PLarge_Integer;
Variable1:integer;
begin
DelayInterval:=1;
Variable1:=NtDelayExecution(true,DelayInterval);
end.
It won't let me set DelayInterval with a constant, I get "Incompatible
Types: got "shortint" expected "Plarge_Integer"
I really don't undertand these variable types that it wants.
More information about the fpc-pascal
mailing list