lrr81765
asked on
Using QueryPerformanceCounter in Perf Counter
I am using QueryPerformanceCounter to determine the amount of time a function takes (transforming XSL templates), and applying that value to a PerformanceCounter object (AverageTimer32) using the following psuedo-code:
_perfmonAvg = New PerformanceCounter("PG", "TimeToTransform", Me.ID.ToString, False)
_perfmonBase = New PerformanceCounter("PG", "TimeToTransformBase", Me.ID.ToString, False)
' End If
_perfmonAvg.RawValue = 0
_perfmonBase.RawValue = 0
Private Sub StartTime()
QueryPerformanceCounter(_s tartTime)
End Sub
Private Sub UpdatePerformance()
Try
Dim _end As Int64
QueryPerformanceCounter(_e nd)
_timetotransform = _end - _startTime
_perfmonAvg.IncrementBy(_t imetotrans form)
_perfmonBase.Increment()
Catch oE As Exception
End Try
End Sub
-------------------------- ----
When I look at the performance counter, I get a value of .778 if the scale is set to 10,000.
I've looked at http://support.microsoft.com/default.aspx?scid=kb;en-us;306978, but it doesn't answer my questions:
1) What is the .778 value in reference to seconds ? (ms, microsecs,ticks? )
2) Do I need to divide using QueryPerformanceFrequency to determine secs/ms?
3) what is the proper setting for the scale to make this read in ms?
Thanks Experts!
_perfmonAvg = New PerformanceCounter("PG", "TimeToTransform", Me.ID.ToString, False)
_perfmonBase = New PerformanceCounter("PG", "TimeToTransformBase", Me.ID.ToString, False)
' End If
_perfmonAvg.RawValue = 0
_perfmonBase.RawValue = 0
Private Sub StartTime()
QueryPerformanceCounter(_s
End Sub
Private Sub UpdatePerformance()
Try
Dim _end As Int64
QueryPerformanceCounter(_e
_timetotransform = _end - _startTime
_perfmonAvg.IncrementBy(_t
_perfmonBase.Increment()
Catch oE As Exception
End Try
End Sub
--------------------------
When I look at the performance counter, I get a value of .778 if the scale is set to 10,000.
I've looked at http://support.microsoft.com/default.aspx?scid=kb;en-us;306978, but it doesn't answer my questions:
1) What is the .778 value in reference to seconds ? (ms, microsecs,ticks? )
2) Do I need to divide using QueryPerformanceFrequency to determine secs/ms?
3) what is the proper setting for the scale to make this read in ms?
Thanks Experts!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.