Mid$ slow

Archives Forums/BlitzPlus Programming/Mid$ slow

ALAN-MHz(Posted 2005) [#1]
Is possible that Mid$ command is really slow ? anyone try to make a long cicle with mid$ command inside ? try this stupid source to test it:

Temp$="try"
Tim=millisecs()
for i=1 to 9999999
a$=mid$(Temp$,1,1)
next
print millisecs()-Tim
input

is only mine problem ? there are some other solution to make a mid$(string,start,lenght) at more fast speed ?


Andy UK(Posted 2005) [#2]
it took 26seconds on my crappy 15gig p4 at work to the command 10 million times.. erm i would say that was ok. At 1000 times it takes 2ms which is nothing.


Nicstt(Posted 2005) [#3]
deleted - missread post


Mimi(Posted 2005) [#4]
try
temp$ + temp$
instead of mid$(...) and you will find a similar calculation time. It's not so slow: 2.5 microseconds per operation on my PC.

Mimi


Grey Alien(Posted 2005) [#5]
you must mean millisecs as microsecs would be real sweet!


Mimi(Posted 2005) [#6]
no I mean microseconds!


Grey Alien(Posted 2005) [#7]
Oh OK, I assumed a type based on the fact that you can only measure Millisecs in Blitz.