Directory reading slow when using #PB_Any
Posted: Thu Apr 12, 2012 7:58 pm
Hi,
today i wrote a procedure to read out a directory recursively to return all filenames contained in a folder and all sub-folders. Playing around with it, i noticed that the procedure tooks more time the more often it gets called. After some further testing, i wrote this sample code to demonstrate the behaviour:
If you change the #PB_Any value to a number (e.g. 0), the procedure keeps fast all the time. I guess there is something odd with the management of the #PB_Any values.
Best regards,
Uwe
today i wrote a procedure to read out a directory recursively to return all filenames contained in a folder and all sub-folders. Playing around with it, i noticed that the procedure tooks more time the more often it gets called. After some further testing, i wrote this sample code to demonstrate the behaviour:
Code: Select all
For i = 1 To 5
e = ElapsedMilliseconds()
For j = 1 To 1000
d = ExamineDirectory(#PB_Any, GetHomeDirectory(), "*.*")
While NextDirectoryEntry(d)
Wend
FinishDirectory(d)
Next
Debug ElapsedMilliseconds() - e
NextBest regards,
Uwe