473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

PerformanceCounterType.ElapsedTime

Does anyone know how to use PerformanceCounterType.ElapsedTime?
When I call calculate, it always returns some weired number between 15000
and 80000 which doesn't make sense.
Nov 16 '05 #1
1 4292
Wally Highsmith wrote:
Does anyone know how to use PerformanceCounterType.ElapsedTime?
When I call calculate, it always returns some weired number between
15000 and 80000 which doesn't make sense.


The problem is that the PerformanceCounter runs at some frequency that
you may not expect. In Win32, QueryPerformanceCounter and
QueryPerformanceFrequency were sufficient to return the info needed to
make any timing calculations. In queryPerformanceType, documented here:
http://tinyurl.com/2arbl

It seems they have tried to maka a more useful class to encapsulate the
functions previously available, and add some new ones. In the
description of the ElapsedTime member, it says:

<quote>
Formula: (D0 - N 0)/ F, where D 0 represents the current time, N 0
represents the time the object was started, and F represents the number
of time units that elapse in one second.
</quote>
The problem is that they do not describe how to obtain F.

Perhaps if you explore some of the sample code on that page, you can
find it....
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: alien2_51 | last post by:
I'm having issues getting some custom performance counters to work.. Here's what I'm trying to do... I want to create one category with two CountPerTimeInterval32 counters, which represent an...
80
by: | last post by:
Is there a performance difference between this: \\\ Dim i As Integer For i = 0 to myObject.Controls.Count - 1 myObject.Controls(i) = ... Next /// and this:
15
by: Mike Lansdaal | last post by:
I came across a reference on a web site (http://www.personalmicrocosms.com/html/dotnettips.html#richtextbox_lines ) that said to speed up access to a rich text box's lines that you needed to use a...
5
by: John Dumais | last post by:
Hello, I have been trying to figure out how to write an array of doubles (in this specific case) to a binary stream without using a loop. What I have been doing is... foreach(double d in...
77
by: Peter Olcott | last post by:
http://www.tommti-systems.de/go.html?http://www.tommti-systems.de/main-Dateien/reviews/languages/benchmarks.html The above link shows that C# is 450% slower on something as simple as a nested loop....
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
16
by: psbasha | last post by:
Hi, Is there any functions available for finding the time from the system?.I would like to find the start time and end time of the processing of the application after execution. Thanks in...
10
by: KiSSFRo | last post by:
Hi, I have a program that does the following: given a directory as it's only argument, it goes to that directory and looks for directories inside that contain 2 special types of very large files....
9
by: Ross | last post by:
I'm a newbie at this, and have searched a lot but can't find something that seems appropriate for measuring a recurring elapsed time. Creating an object with: var mydate = new Date(); seems...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.