FW using processortime

Post Reply
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

FW using processortime

Post by driessen »

Hello,

How can I prevent that the next loop is using 100% processortime ?

This is the loop :

------------------------------
DO WHILE .T.
IF VActive
SYSREFRESH()
LOOP
ENDIF
EXIT
ENDDO
------------------------------

Thanks a lot in advance.

Michel D.
M&A Consult bvba
Genk (Belgium)
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Michel,

Try Sleep( 1 ) instead of Sysrefresh()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Couldn't you use a timer?
Regards
Otto
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

Antonio,
Otto,

Thanks a lot for you answers.

Antonio, sleep() is an unknown function in FW for Clipper.

Otto, I never thought of a timer. I'll try it out.

Thank you.

Michel
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

This is a working sample of Sleep() definition:

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    SLEEP( 2000 )

    RETURN NIL


DLL32 FUNCTION SLEEP( nMilliseconds AS DWORD ) AS VOID;
      PASCAL FROM "Sleep" LIB "kernel32.dll"
EMG
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

Thanks a lot guys.

I'll try out your suggestions.

Michel
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Michel,

What do you use that loop for ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply