Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INKEY() Speed
Message
From
02/01/2011 17:20:13
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
02/01/2011 15:30:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01494340
Message ID:
01494347
Views:
92
>Hi All,
>
>Whys is INKEY("H") orders of magnitude slower than just plain INKEY() ?
>
>
>CLEAR
>
>* Sub-second ...
>
>TSECONDS = SECONDS()
>FOR I = 1 TO 100
>  TA=INKEY()
>NEXT
>? SECONDS() - TSECONDS
>
>* Over 6 seconds ! ...
>
>TSECONDS = SECONDS()
>FOR I = 1 TO 100
>  TA=INKEY("H")
>NEXT
>? SECONDS() - TSECONDS
>
Off the top of my head, plain inkey() only looks whether there's a keystroke left in the keyboard buffer. With H, it has to call some system routine which checks who knows what and notifies who knows how many other services that the cursor is now hidden.

But that's just a guess. I actually don't know.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform