LoginSignup
0
0

タイマー

Posted at

Sub CalculateProcessingTime()
Dim startTime As Double
Dim endTime As Double
Dim processingTime As Double

' 開始時間を記録
startTime = Timer
Debug.Print "Start Time: " & Format(Now, "hh:nn:ss AM/PM")

' 実行したい処理
' (ここに処理を書きます。例として、1秒待機する処理を入れています)
Application.Wait Now + TimeValue("00:00:01")

' 終了時間を記録
endTime = Timer
Debug.Print "End Time: " & Format(Now, "hh:nn:ss AM/PM")

' 処理時間を計算
processingTime = endTime - startTime

' 処理時間をメッセージボックスに表示
MsgBox "Processing Time: " & Format(processingTime, "0.00") & " seconds"

End Sub

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0