Solved

How to measure CPU time?

Posted on 1998-12-24
3
786 Views
Last Modified: 2013-11-15
Often in research paper, the author compares
the execution time of a algorithm by plotting
CPU time vs the input data (e.g number
of elements to be processed).
How is CPU time determined?

In Window NT Task Manager, in the "Processes" property page
there is a column on "CPU time" for the various processes.
How do we interprete these numbers?
0
Comment
Question by:leowlf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1181034
In research papers, the CPU time is a theoretical unit of time. Basically, each atomic statement is treated as one unit of time. A statement in C++ would be one unit of time, i.e. assuming i is of type integer,

  i = 3;

would be O(1) (time complexity of 1).

But a for loop would be measured by the number of times through the loop:

  for (int j = 0; j < 10; j++)
  {
    i = 3;
  }

This would be O(10) because i = 3 takes O(1) and the for loop gets executed 10 times. Therefore the overall loop is O(10). In general if there are n iterations through a loop and the statement inside the loop is O(1), then the time complexity of the loop is n * O(1), which is O(n).

But these are all theoretical units of CPU time. On NT, the CPU time is the amount of time in seconds spent executing the statements in the program. These are real times and is dependent on the CPU in the machine.

These times have a relationship to the theoretical CPU units of time, but to calculate it would be near impossible because there are too many things that can change it.
0
 
LVL 84

Expert Comment

by:ozo
ID: 1181035
O(10) is the same as O(1)
0
 
LVL 11

Expert Comment

by:alexo
ID: 1181036
For NT, you can use the GetProcessTimes() function.
0

Featured Post

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CD Rom not playing 13 88
Mutiple Folder view (5 Folder view) 3 81
Best way to encrypt a xls file 8 63
watsup photo saving 6 23
Let’s list some of the technologies that enable smooth teleworking. 
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question