Hi all,
QueryPerformanceCounter returns a LARGE_INTEGER, which the documentation
states is equivalent to a signed 64-bit integer. My question is, can
QueryPerformanceCounter return negative values, or is its output restricted
to positive values? TIA! 6 2068
Hi Bob Altman, QueryPerformanceCounter returns a LARGE_INTEGER, which the documentation states is equivalent to a signed 64-bit integer. My question is, can QueryPerformanceCounter return negative values, or is its output restricted to positive values? TIA!
QueryperformanceCounter internaly sometimes uses the RDTSC instruction. And
this value is an unsigned 64-bit value. Therefor if you interpret this
value as signed, it might become negative...
BUT: On current processor speeds (3GHz) it will take about 95 years of a
continuous running CPU to reach the "negative" value.
--
Greetings
Jochen
My blog about Win32 and .NET http://blog.kalmbachnet.de/
"Jochen Kalmbach" <no********************@holzma.de> wrote in message
news:Xn*********************************@207.46.24 8.16... QueryPerformanceCounter returns a LARGE_INTEGER, which the documentation states is equivalent to a signed 64-bit integer. My question is, can QueryPerformanceCounter return negative values, or is its output restricted to positive values? TIA!
QueryperformanceCounter internaly sometimes uses the RDTSC instruction. And this value is an unsigned 64-bit value. Therefor if you interpret this value as signed, it might become negative...
To be exact, QPC/QPF use different counters under different circumstances.
On my system, the clock used for these functions is much slower than the CPU
clock; I believe it's using some clock on the motherboard. If you think
about the multi-CPU case, RDTSC stops making sense.
--
Tim Robinson
MVP, Windows SDK
Hi Tim Robinson, QueryPerformanceCounter returns a LARGE_INTEGER, which the documentation states is equivalent to a signed 64-bit integer. My question is, can QueryPerformanceCounter return negative values, or is its output restricted to positive values? TIA!
QueryperformanceCounter internaly sometimes uses the RDTSC instruction. And this value is an unsigned 64-bit value. Therefor if you interpret this value as signed, it might become negative...
To be exact, QPC/QPF use different counters under different circumstances. On my system, the clock used for these functions is much slower than the CPU clock; I believe it's using some clock on the motherboard. If you think about the multi-CPU case, RDTSC stops making sense.
I just wanted to show that in the fastes possible implementation (RDTSC),
it will take 95 years to become negative!
--
Greetings
Jochen
My blog about Win32 and .NET http://blog.kalmbachnet.de/
"Jochen Kalmbach" <no********************@holzma.de> wrote in message
news:Xn*********************************@127.0.0.1 ...
[...] To be exact, QPC/QPF use different counters under different circumstances. On my system, the clock used for these functions is much slower than the CPU clock; I believe it's using some clock on the motherboard. If you think about the multi-CPU case, RDTSC stops making sense.
I just wanted to show that in the fastes possible implementation (RDTSC), it will take 95 years to become negative!
A fair point :).
/me goes and tests Jochen's theory
--
Tim Robinson
MVP, Windows SDK
But the TSC can be user-set to any value, at
any time. Not that you'd want to, but anyone
(typically) could.
--
40th Floor - Software @ http://40th.com/
iPlay : the ultimate audio player for PPCs
mp3,mp4,m4a,aac,ogg,flac,wav,play & record
parametric eq, xfeed, reverb: all on a ppc
Hi , But the TSC can be user-set to any value, at any time. Not that you'd want to, but anyone (typically) could.
Not 100% true...
<quote>
When the WRMSR instruction is used to write to the time-stamp
counter, only the low order 32-bits of the time-stamp counter can be
written to, and the highorder 32 bits cleared to all 0s.
</quote>
--
Greetings
Jochen
My blog about Win32 and .NET http://blog.kalmbachnet.de/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David Mitchell |
last post by:
Hello group,
I'm trying to write code to test an application we're developing. This
application needs to store its own performance data in the registry, and
we'd like to be storing quite a...
|
by: Gustavo L. Fabro |
last post by:
Greetings!
Getting straight to the point, here are the results
of my experiment. I've included my comments and questions
after them.
The timing:
(The total time means the sum of each line's...
|
by: David Wagner |
last post by:
Hi,
I am looking at wanting to configure and manage some
Performance Monitor logs through a C# application.
Specifically, I want to be able to define and configure
named performance log...
|
by: Christopher Attard |
last post by:
Hi,
I need to create a dialog like the 'Add Counters' dialog box in
perfmon. I'm using the System.Diagnostics namespace class in .NET and I've
managed to do it.
The problem arises when I'm...
|
by: James |
last post by:
Hi
Has anybody had any experience of ASP.Net performance counters not updating.
In the performance monitor application when I try to add the groups ASP.NET
and ASP.NET Applications the...
|
by: Salvador |
last post by:
Hi,
I have created a service, which installer installs 5 performance counters as
well. Then the service instances these counters and interact with them.
If I check the event viewer I receive...
|
by: NAdir |
last post by:
Hi, thank you for your help.
My VB.Net application contains a document that the user can refresh at any
time.
The refresh works fine and needs to loop through few datatables (hundreds of
rows)....
|
by: jvn |
last post by:
I am experiencing a particular problem with performance counters.
I have created a set of classes, that uses
System.Diagnostics.PerformanceCounter to increment custom performance
counters (using...
|
by: Dev - |
last post by:
Hi,
Iam monitoring the performance of WCF Application. I have added the WCF Counters ServiceModelEndPoint/Operation/Service. Of these three counters, when i start the perfmon the values for...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |