473,840 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How does Process.TotalPr ocessorTime act on a multi-processor computer?

For example, if you have a dual-processor computer, and your process
runs for an hour using 100% of both CPUs, would
Process.TotalPr ocessorTime return a TimeSpan representing one hour or
two?

thanks
Nov 15 '05 #1
2 4061
I don't have more than one CPU, but I do have a multi-threading CPU (to the
OS, it looks exactly like two CPUs), and the TotalProcessorT ime works as it
should. Also (assuming you have a dual-processor system), you can look at
the processor time in the processes list of the task manager. If that's
correct, then Process.TotalPr ocessorTime will also be correct, as they use
the same APIs to get the result.

Chris

"john" <jo********@yah oo.com> wrote in message
news:29******** *************** ***@posting.goo gle.com...
For example, if you have a dual-processor computer, and your process
runs for an hour using 100% of both CPUs, would
Process.TotalPr ocessorTime return a TimeSpan representing one hour or
two?

thanks

Nov 15 '05 #2
"Chris LaJoie" <ch***@etriptra der.com> wrote in message news:<O2******* *******@TK2MSFT NGP10.phx.gbl>. ..
I don't have more than one CPU, but I do have a multi-threading CPU (to the
OS, it looks exactly like two CPUs), and the TotalProcessorT ime works as it
should. Also (assuming you have a dual-processor system), you can look at
the processor time in the processes list of the task manager. If that's
correct, then Process.TotalPr ocessorTime will also be correct, as they use
the same APIs to get the result.

Chris


Can you explain what you mean when you say "TotalProcessor Time works
as it should"? I am trying to figure out what "should" is. If you have
a dual-processor computer, and your process runs for an hour using
100% of both CPUs, would Process.TotalPr ocessorTime return a TimeSpan
representing one hour or
two?

thanks
Nov 15 '05 #3

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

Similar topics

2
3979
by: ian douglas | last post by:
I have one process that will be multi-threaded. The parent (A) will sit and deal with TCP/IP issues, and feed data to its child process (B) via shared memory. I need assistance in finding a good example of (B) pausing (not in a busy-wait loop) until it gets a signal from (A) that data is ready. That the child process (B) will then have a shared memory segment with a second running process (C), where (B) will be the producer for (C), so...
2
1815
by: Chris | last post by:
I have a form with a textbox and i want to populate the textbox with the CPU time for a program called program.exe How do i specify showing only the CPU time for the one executable I want?
22
5079
by: nd02tsk | last post by:
Hello! I have a couple of final ( I hope, for your sake ) questions regarding PostgreSQL. I understand PostgreSQL uses processes rather than threads. I found this statement in the archives: "The developers agree that multiple processes provide more benefits (mostly in stability and robustness) than costs (more
2
5027
by: Ivan | last post by:
I have a class Foo which have two property. I have a thread that do some process and update class Foo int B. I have a datagridview on main form. this datagridview data source to this class Foo and column A binds to string A and column B binds to int B. When i start two threads, the datagridview able to show two rows and updated int B at run time. How? public class Foo { public Foo()
6
2985
by: TyBreaker | last post by:
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
2
5738
by: Lyon | last post by:
Here is a part of my code: internal bool Excute(string input) { ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = this.filePathToExcute; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true;
0
1477
by: Lyon | last post by:
Here is a part of my code: internal bool Excute(string input) { ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = this.filePathToExcute; psi.RedirectStandardOutput = true; psi.RedirectStandardError = true;
113
5357
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside the Python world, you're fine. But once you do, things go downhill. MySQLdb has version and platform compatibility problems. So does M2Crypto. The built-in SSL support is weak. Even basic sockets don't quite work right; the socket module...
5
1950
by: Coaster | last post by:
I am designing a process which will spawn a good number of threads and some of them will execute a c++ process which is quite memory intensive (although not multithreaded). This will run on a 2 cpu (both dual core) server. What do I need to do if anything in order to spread the workload across the cpu's / cores in order to tune it properly? I googled it and found this post but its somewhat dated and didn't know if it applied to 2.0
4
6861
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.
0
9860
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
9699
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
10922
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
10603
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7838
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7023
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
5874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4076
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3138
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.