Hi developers,

I made this little test because I was getting 100% CPU usage in some old code when using RC1 (rev 8779) and BCC55 on Windows XP. In xharbour I did not get 100% CPU. The help file says the granularity of inkey() is 1/10 of a second. Should be 1/100? The loop below does not run if I put inkey(0.001).

(Also note the SET TYPEAHEAD test in tests/inkeytst.prg does not work for me)


procedure main()

local nkey

      Do While .t.
         nKey := InKey(0.1)
         If nKey != 0
          EXIT
         EndIf
         ?? "X"
      EndDo

      Do While .t.
         nKey := InKey(0.01)
         If nKey != 0
          EXIT
         EndIf
         ?? "Y"
      EndDo

      Do While .t.
         nKey := InKey(0.001)
         If nKey != 0
          EXIT
         EndIf
         ?? "Z"
      EndDo

      ? "CPU check..."
      Do While .t.
         nKey := InKey()
         If nKey != 0
          EXIT
         EndIf

      EndDo

return

Regards,
George

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to