AW: Zeitrechnung
21.12.2010 22:53:49
Josef
Hallo Peter,
eine Möglichkeit.
' **********************************************************************
' Modul: Modul1 Typ: Allgemeines Modul
' **********************************************************************
Option Explicit
Private Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Private Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Public Function SysTime() As Double
Dim st As SYSTEMTIME
GetSystemTime st
With st
SysTime = .wHour / 24 + .wMinute / 1440 + .wSecond / 86400 + .wMilliseconds / 86400000
End With
End Function
Sub xyz()
Dim dblStart As Double, dblEnd As Double, dblDiff As Double
Dim strOutput As String
Dim lngI As Long
dblStart = SysTime
'dummy
For lngI = 0 To 500000000
Next
dblEnd = SysTime
dblDiff = dblEnd - dblStart
With WorksheetFunction
strOutput = .Text(dblStart, "hh:mm:ss.000")
strOutput = strOutput & " - " & .Text(dblEnd, "hh:mm:ss.000")
strOutput = strOutput & " : " & .Text(dblDiff, "hh:mm:ss.000")
End With
Application.StatusBar = strOutput
End Sub
Gruß Sepp