Skip to content

Instantly share code, notes, and snippets.

@nobrinskii
Created March 16, 2012 05:25
Show Gist options
  • Save nobrinskii/2048634 to your computer and use it in GitHub Desktop.
Save nobrinskii/2048634 to your computer and use it in GitHub Desktop.
[vba/excel] 実行時間時間計測関連
'##############################################################################
'実行時間時間計測関連
'##############################################################################
'ForDebug----------------------------------------------------------------------
'時間計測
Dim timeStart As Date
Dim timeEnd As Date
timeStart = Time$
'ForDebug----------------------------------------------------------------------
'ForDebug----------------------------------------------------------------------
'時間計測
timeEnd = Time$
Debug.Print "経過時間:" & DateDiff("s", timeStart, timeEnd)
'ForDebug----------------------------------------------------------------------
'時間計測をするための宣言
Declare Function GetTickCount Lib "kernel32" () As Long
Declare Function timeGetTime Lib "winmm.dll" () As Long
'ForDebug----------------------------------------------------------------------
'時間計測
Dim timeStart As Long
Dim timeEnd As Long
timeStart = GetTickCount()
'ForDebug----------------------------------------------------------------------
'ForDebug----------------------------------------------------------------------
'時間計測
timeEnd = GetTickCount()
Debug.Print "経過時間:" & CSng((timeEnd - timeStart) / 1000)
'ForDebug----------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment