## Comparing Mid\$ with string pointer

Thanks Eros for the note about using the pointer for a string in the thread Advent of Code, 2017 by Petr, it is much speedier than Mid\$
i have tested a timing demo for a text of 270000 digits, when we use pointers its time is about 0.15 seconds but with Mid\$ it is around 3.9 , ie 27 times speedier. i choose input String input = Repeat\$(30000, "123456789") for reasonable waiting time
if we replace 30000 by 300000, with pointer the time is about 1.6 sec. but with Mid\$ it seems like Mid\$ lost in the space for the text of 2,700,000 digits, even it should return after about 60 seconds, i have waited 5 minutes and then closed the console. it seems the time for the Mid\$ is exponentially larger with the increasing length of the string.
so i deduce Mid\$ is suitable for everyday strings while pointer to string is suitable for huge strings
Uses "console"
Long total

Extended T3

String input = Repeat\$(30000, "123456789")
Long index
Dim TXT(Len(input)) As String * 1 At StrPtr(input)
PrintL "length of the numeric text= " + UBound(TXT)
HiResTimer_Init
T1 = HiResTimer_Delta
For index = 1 To Len(input)

total + TXT(index)
'total + Mid\$(input, index,1)
Next
T2 = HiResTimer_Delta
PrintL "sum of digits= " + total

T3 = T2-T1
T3 = T3/1000000 'the one second = million microseconds
PrintL LTrim\$(Str\$(T3))+ " (seconds)"
WaitKey