' Timer and benchmarking: TIMER, DELAY, TIX for performance measurement
#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    LOCAL t1  AS LONG
    LOCAL t2  AS LONG
    LOCAL tix1  AS LONG
    LOCAL tix2  AS LONG
    LOCAL i  AS LONG
    LOCAL sum  AS LONG
    t1 = TIMER
    tix1 = TIX

    sum = 0
    FOR i = 1 TO 100000
        sum = sum + i
    NEXT i

    t2 = TIMER
    tix2 = TIX

    PRINT "Sum result:"; sum
    PRINT "TIMER elapsed (ms):"; t2 - t1
    PRINT "TIX elapsed:"; tix2 - tix1
    PRINT "TIMER precision test complete."

    FUNCTION = 0
END FUNCTION
