Home Forums HTBasic Forum Add tools to HTBasic Reply To: Add tools to HTBasic

#4492
ZeRider
Participant

    Hello,
    As you know HTBasic cannot handle new computers with multi-core CPUs.
    This can slow down calculations or file storage enormously.
    The solution is to force the modification of the affinity so as to increase the processor number used during resource-intensive operations.
    On the other hand, during screen displays, it is better to keep the original affinity on single processor.
    To do this job I use the NirCmd freeware utility, to download here : https://www.nirsoft.net/utils/nircmd.html
    Please find bellow my code. Hope that help somebody …

    DIM Application$[80]
    DIM Disque$[80],Prog$[200]
    DIM Command$[200]
    !
    Application$=”HTBwin10″&”\HTBwin.exe”
    Application$=”C:\Program Files (x86)\”&Application$
    !
    Affinity=0 ! Normal case
    Affinity=4 ! For test, To use multi-core processors 0 to 4
    !
    Prog$=”nircmd.exe”
    Disque$=Nircmd_directory$ ! Need to be completed with the correct directory …
    Disque$=Disque$&”\NirCmd\nircmd-x64″
    Prog$=Disque$&”\”&Prog$
    !
    SELECT Affinity
    CASE 0
    K$=” 0″
    CASE ELSE
    K$=” 0″
    FOR I=1 TO Affinity
    K$=K$&” “&VAL$(I)
    NEXT I
    END SELECT
    !
    Command$=”cmd /C start /MIN “&Prog$&” setprocessaffinity “&””””&Application$&””””&K$
    EXECUTE CHR$(13)&Command$
    !
    END

    Scroll to Top
    HTB icon

    Please Sign In