掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
正しく関数から値を返すには? (ID:75677)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
> 値渡しは変えないほうがパフォーマンス的にはいいです。 ??VB5ではあきらかに値渡しの方が実行速度が遅いようですが 環境が違うと動作が異なるのでしょうか? それとも、パフォーマンスが良いとは もっと別のことを差しているのでしょうか? 一応、確認に使用したコードです。 Private Declare Function timeGetTime Lib "winmm.dll" () As Long Private Sub Command1_Click() Dim i As Long Dim a As String Dim tm As Long a = "あいうえおかきくけこさしすせそ" tm = timeGetTime() For i = 0 To 800000 Call testVal(a) Next i tm = timeGetTime() - tm Me.Caption = tm End Sub Private Sub Command2_Click() Dim i As Long Dim a As String Dim tm As Long a = "あいうえおかきくけこさしすせそ" tm = timeGetTime() For i = 0 To 800000 Call testRef(a) Next i tm = timeGetTime() - tm Me.Caption = tm End Sub Private Sub testVal(ByVal a As String) End Sub Private Sub testRef(ByRef a As String) End Sub
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.