Announcement

Collapse
No announcement yet.

Modeless for DIALOG NEW Maximizes CPU, place sleep statement in do events

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Modeless for DIALOG NEW Maximizes CPU, place sleep statement in do events

    here is what i have done to my gui programs where modeless dialogs are created,

    the MODELESS DIALOG seems to create bad cpu usage.


    DO
    DIALOG DOEVENTS TO Count&
    IF SLOWDOWNCOUNT& MOD 10000 =0 THEN SLOWDOWNCOUNT&=0:SLEEP 1
    INCR SLOWDOWNCOUNT&
    LOOP UNTIL Count&=0


    My question is since i have first placed sleep 1 statements into the DO EVENTS LOOP.

    What seems to be the best code for all computers inside the loop

    i wanted to get some feedback in this area across the board.

    thanks paul
    p purvis

  • #2
    Hi Paul,

    Can this be reason for the issue?
    http://www.powerbasic.com/support/pb...ad.php?t=35253

    Regards,
    Tonny

    Comment


    • #3
      Paul, what Tonny pointed you to is correct. SLEEP 1, is not equivalent to DIALOG DOEVENTS 1 TO Count&. You want to use DIALOG DOEVENTS 1 TO Count&.
      Adam Drake
      Drake Software

      Comment

      Working...
      X