test

Sub v4() '运行时间0.01秒
 Dim t
 t = Timer
 For x = 1 To 100000
   m = m + 1000 '真接调用内存中的值
 Next x
 MsgBox Timer - t
End Sub

Sub v5() '运行时间0.5秒
 Dim t
 t = Timer
 For x = 1 To 100000
   m = m + Cells(1, 1) '调用单元格中的值
 Next x
  MsgBox Timer - t
End Sub
赞(0)
未经允许不得转载:何嘉嘉 » test

相关推荐