Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable string sizes in file i/o
#4
Ok, just did a test of String$() vs Space$().

Space$() wins.

10 loops of 50,000.
Code:
%Faster    69.2|    83.3|    76.9|    69.2|    69.2|      50|    69.2|    83.3|    64.3|    57.1
Test1        22|      22|      23|      22|      22|      21|      22|      22|      23|      22
Test2        13|      12|      13|      13|      13|      14|      13|      12|      14|      14

10 loops of 10,000.
Code:
%Faster     200|     200|     200|     200|     200|     200|     200|     200|     200|     200
Test1         3|       3|       3|       3|       3|       3|       3|       3|       3|       3
Test2         1|       1|       1|       1|       1|       1|       1|       1|       1|       1

Code:
Public Sub TestOne()
Dim s As String
    s = String$(40, " ")
End Sub

Code:
Public Sub TestTwo()
Dim s As String
    s = Space$(40)
End Sub
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)