473,809 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System Idle Process

I am using a performance counter to record the "Elapsed (CPU) time" of
the "Idle" process. I record the elapsed time, wait 1 second and then
record the new elapsed time. The result I get is:

before: 175437046.875
after: 175438093.75
CPU time used: 1046.875

However I was running Prime95 at the same time and I obtained the
following stats during the same interval (used managed .NET call
Process.TotalPr ocessorTime.Tot alMilliseconds) :

before: 295905.4912
after: 296896.9168
CPU time used: 991.4256

Now my understanding of the System Idle Process is that it counts the
spare CPU time only. However for a 1 second interval both the Idle and
Prime95 processes appear to have clocked up nearly 1 second each! I
must be missing something here because this should be impossible,
correct? Just to clarify, I have a single CPU which only displays a
single CPU graph in Task Manager (hence isn't hyper-threaded or dual core).

Grateful for any guidance, thanks!

--
______ ___ __
/_ __/_ __/ _ )_______ ___ _/ /_____ ____
/ / / // / _ / __/ -_) _ `/ '_/ -_) __/
/_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/
/___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.
Sep 16 '06 #1
6 2984
You are using 2 different timings:
Idle process: Elapsed CPU time
Prime95: TotalProcessorT ime

so you can not compare them ...

TyBreaker wrote:
I am using a performance counter to record the "Elapsed (CPU) time" of
the "Idle" process. I record the elapsed time, wait 1 second and then
record the new elapsed time. The result I get is:

before: 175437046.875
after: 175438093.75
CPU time used: 1046.875

However I was running Prime95 at the same time and I obtained the
following stats during the same interval (used managed .NET call
Process.TotalPr ocessorTime.Tot alMilliseconds) :

before: 295905.4912
after: 296896.9168
CPU time used: 991.4256

Now my understanding of the System Idle Process is that it counts the
spare CPU time only. However for a 1 second interval both the Idle and
Prime95 processes appear to have clocked up nearly 1 second each! I
must be missing something here because this should be impossible,
correct? Just to clarify, I have a single CPU which only displays a
single CPU graph in Task Manager (hence isn't hyper-threaded or dual core).

Grateful for any guidance, thanks!
Sep 17 '06 #2
Theo Verweij wrote:
You are using 2 different timings:
Idle process: Elapsed CPU time
Prime95: TotalProcessorT ime

so you can not compare them ...
Woah! Really? I though the total processor time meant the total
processor time (kernel time plus user time) for a particular process?

--
______ ___ __
/_ __/_ __/ _ )_______ ___ _/ /_____ ____
/ / / // / _ / __/ -_) _ `/ '_/ -_) __/
/_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/
/___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.
Sep 25 '06 #3
TyBreaker wrote:
Theo Verweij wrote:
>You are using 2 different timings:
Idle process: Elapsed CPU time
Prime95: TotalProcessorT ime

so you can not compare them ...

Woah! Really? I though the total processor time meant the total
processor time (kernel time plus user time) for a particular process?
The Visual Basic.NET help indicates Process.TotalPr ocessorTime is the
total CPU time for the particular process. So I should be able to
compare that to the Elapsed time for the System Idle Process over any
given interval eg 1 second. Unless I'm missing something?

--
______ ___ __
/_ __/_ __/ _ )_______ ___ _/ /_____ ____
/ / / // / _ / __/ -_) _ `/ '_/ -_) __/
/_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/
/___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.
Sep 25 '06 #4
TotalProcessorT ime: The processortime consumed by the process
ElapsedCpuTime: The cputime elapsed between 2 measurements, not
neccesary used by your process (preemtive multitasking ...)

TyBreaker wrote:
TyBreaker wrote:
>Theo Verweij wrote:
>>You are using 2 different timings:
Idle process: Elapsed CPU time
Prime95: TotalProcessorT ime

so you can not compare them ...

Woah! Really? I though the total processor time meant the total
processor time (kernel time plus user time) for a particular process?

The Visual Basic.NET help indicates Process.TotalPr ocessorTime is the
total CPU time for the particular process. So I should be able to
compare that to the Elapsed time for the System Idle Process over any
given interval eg 1 second. Unless I'm missing something?
Sep 27 '06 #5
To be more precise:

Prime95 is measuring the total processor time used by your process.
Your process used 991.4 milliseconds

The elapsedcputime is measuring the real processor time that has elapsed
(1 second/second/processor, so with dual processor there are 2 cpu
seconds per second). The time elapsed on your single processor machine
was 1046.8 milliseconds.

This means that 1046.8 - 991.4 = 55.4 milliseconds were used for one or
more other processes. That the measurement of the elapsed cpu time isn't
exactly 1 second is caused by the time slices of the preemtive
multitasking, wich are variable and at least 20ms each.
Theo Verweij wrote:
TotalProcessorT ime: The processortime consumed by the process
ElapsedCpuTime: The cputime elapsed between 2 measurements, not
neccesary used by your process (preemtive multitasking ...)

TyBreaker wrote:
>TyBreaker wrote:
>>Theo Verweij wrote:
You are using 2 different timings:
Idle process: Elapsed CPU time
Prime95: TotalProcessorT ime

so you can not compare them ...

Woah! Really? I though the total processor time meant the total
processor time (kernel time plus user time) for a particular process?

The Visual Basic.NET help indicates Process.TotalPr ocessorTime is the
total CPU time for the particular process. So I should be able to
compare that to the Elapsed time for the System Idle Process over any
given interval eg 1 second. Unless I'm missing something?
Sep 27 '06 #6
Theo Verweij wrote:
Prime95 is measuring the total processor time used by your process.
Your process used 991.4 milliseconds
OK, understood.
The elapsedcputime is measuring the real processor time that has elapsed
(1 second/second/processor, so with dual processor there are 2 cpu
seconds per second). The time elapsed on your single processor machine
was 1046.8 milliseconds.
Ah this is where I'm confused then. I ran perfmon to see what counters
existed and the description for Process\Elapsed Time indicates it
records "The total elapsed time, in seconds, that this process has been
running." so I understood it to be specific to the particular process I
had nominated - in this case the Idle process:

Private IdleCpuUsage As PerformanceCoun ter = New
PerformanceCoun ter("Process", "Elapsed Time", "Idle")

I notice I do get different values for this performance counter
depending on whether I point it at Idle or say, Firefox. If it is
recording the total CPU time irrespective of any particular process,
shouldn't the value being graphed be the same irrespective of which
process I nominate?
--
______ ___ __
/_ __/_ __/ _ )_______ ___ _/ /_____ ____
/ / / // / _ / __/ -_) _ `/ '_/ -_) __/
/_/ \_, /____/_/ \__/\_,_/_/\_\\__/_/
/___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.
Sep 27 '06 #7

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

Similar topics

3
2466
by: john | last post by:
I don't want to know what the CPU utilization is right now. I want to get the average utilization over the last, for example, hour. So I came up with a method where I would get a Process object representing the "Idle" process. I would figure out what percentage of time the idle process has been running since my function last was called. Then the average CPU utilization would be 100 - average idle percentage. I figure out the average idle...
5
2141
by: Kevin Buchan | last post by:
How can I tell if the system is 'idle', or the screen saver is running, or the machine is locked? I am writing an application that could really benefit from knowing this information. During 'idle' time, I could do some of the slightly heavier processing; during the 'working' time, I would display the non-intrusive notifications that I don't want my customer to miss. I see that I can apparently set the thread priority of my background...
0
1461
by: Stefan Felkel | last post by:
hi! i have searched a lot in these pgsql-groups and on the internet, but found no really helpful information for my problem. the famous error >> database "xyz" is being accessed by other users is my problem.
5
3459
by: =?Utf-8?B?Z215ZXJz?= | last post by:
Hello, I am attempting to start a cmd.exe process and pass several .vbs scripts (with additional parameters) and then read the output from the scripts and make "notes" in a DataTable (the "notes" not being the issue). Beginning with... Dim objProcess As Process Dim objProcessStartInfo As New ProcessStartInfo
6
5086
by: Michael | last post by:
I need to copy a huge file (around 300Mb) from a mapped network drive to another. I have created a console application and used System.IO.File.Copy function. But I want to know the process of this copying work. Is there any way? I am thinking that I can get the file size, but I don't know how to get the size copied. Thanks.
4
6860
by: archana | last post by:
Hi all, I want to get idle time of process. Means time in which process is sitting idle. Can i do this in c#. Because what i want is those process which are not running since say last 10 mins kill those processes.
5
3308
by: Saya | last post by:
Hi Folks, I have now spend app. 3 days to get the below scenario to work, but can not get there! ..Net version = 2.0.50727 Windows version = Microsoft Windows = Windows Server 2003 Now I have to develop a webservice which is run on the server. The
1
2718
by: George2 | last post by:
Hello everyone, In your experience, what is system idle process doing? In my experience, this means system is (CPU is waiting for) doing some I/O, 1. like hard page fault; 2. waiting for information from network. Are there any other cases which will cause system idle process happen
3
2457
by: W. Watson | last post by:
After simply trying to write a program with help(MakeQTE), a module, and having it fail with socket errors, I decided to restart IDLE, thinking I knew the cause. I'm now getting msgs like: "IDLE's subprocess didn't make connection. ... firewall may be blocking the connection." I doubt the FW connection. There's a small X warning dialog that says "Socket Error: Connection refused." Is there a way to reset IDLE? -- Wayne Watson (Nevada...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.