Found this little gem today. It is called in all the DDE-based functions in the unit. Nice.
Found this little gem today. It is called in all the DDE-based functions in the unit. Nice.
procedure DelayWithTimer(DelayTimeMSec: longint);
// Note: 1000 msec = 1 second
// New results (1gighertz): 12,500 ProcessMessages ~ 1 msec.
// Old results (100meghertz): 125 ProcessMessages ~ 1 msec.
// The smallest delay possible in this proc is 1 msec (10 msec in actuality).
var ii, StartTime, TimeNow : Longint;
begin
StartTime := 0;
if (DelayTimeMSec > 1) then StartTime := GetTheTimeMSEC; // Trick for 1 msec delay!
repeat
for ii := 1 to 12500 do Application.ProcessMessages;
TimeNow := GetTheTimeMSEC;
until (TimeNow > (StartTime+DelayTimeMSec)) or (TimeNow < StartTime);
end; // DelayWithTimer
procedure DelayWithTimer(DelayTimeMSec: longint);
// Note: 1000 msec = 1 second
// New results (1gighertz): 12,500 ProcessMessages ~ 1 msec.
// Old results (100meghertz): 125 ProcessMessages ~ 1 msec.
// The smallest delay possible in this proc is 1 msec (10 msec in actuality).
var ii, StartTime, TimeNow : Longint;
begin
StartTime := 0;
if (DelayTimeMSec > 1) then StartTime := GetTheTimeMSEC; // Trick for 1 msec delay!
repeat
for ii := 1 to 12500 do Application.ProcessMessages;
TimeNow := GetTheTimeMSEC;
until (TimeNow > (StartTime+DelayTimeMSec)) or (TimeNow < StartTime);
end; // DelayWithTimer
LOL! Where's the Tubo button... might need it in the near future!
ReplyDeleteWhat!? Wait. What!?!?!? Does this even work?
ReplyDeleteDear Google! We need a FACEPALM+ button :D
ReplyDeleteWow... that was clever...
ReplyDeleteCreative :)
ReplyDeletemust have been a reason for that at some point...
ReplyDeleteHow many of these can you have active on one form before the setup implodes? Just a counter, a label, a button and a bit of time should be enough to find out.
ReplyDeleteOf all sick code you posted ever this one wins by far.
ReplyDeleteI realy like the comments, this function does not age well.
ReplyDeleteMust have been a rip-off from Microsoft's Windows 3.11 source code
ReplyDeleteEstimate this code was written circa 1996
ReplyDeleteLOL! Just wow!
ReplyDelete