Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > difference between "total cpu time" & "elapsed time"

difference between "total cpu time" & "elapsed time"
Thread Tools
neilxu
Junior Member
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 2, 2004, 12:43 AM
 
Ran some big program on AIX system. After finishing computing, there were some output files. One records the time: "total cpu time" and "elapsed time".

What's the difference? searched google but no clue. It seems like something about "efficiency".

Here is what I guess:
total CPU time is the time CPU took to compute. But what is "elapsed time" ? which is always longer than cpu time, and very longer.

thanks
     
Earth Mk. II
Mac Elite
Join Date: Feb 2001
Location: Washington, DC
Status: Offline
Reply With Quote
Jul 2, 2004, 08:20 AM
 
the difference is what you'd expect it to be:

CPU Time is the time the CPU spent actually executing your program. This need not be a continuous measurement of time, and since only 1 process may be executed on 1 CPU at any given time, your program is not executed continuously, but rather in chunks doled out by the kernel's CPU scheduler.

Elapsed time is the duration your program is running. This is measured continuously from when a process is born until it dies.

For example, you have some program that (for the sake of argument) sorts though a file of stuff and outputs some useful data. You run the program, and 3 minutes later, the results are displayed. That's elapsed time.

If you wanted to check, however, you might find that the CPU time is only 1 min 30 secs. What's going on? Well, since you were running Safari with a text field open in the background and iTunes with its special effects on, the CPU only spent 1:30 actually executing your program's code. The rest of that 3 mins was spent doing something else.
/Earth\ Mk\.\ I{2}/
     
neilxu  (op)
Junior Member
Join Date: Aug 2002
Status: Offline
Reply With Quote
Jul 2, 2004, 02:03 PM
 
thank you very much.

now what really bothers me is the "elasped time" increases a lot when I add second CPU.

single CPU
Total CPU time: 4.871
Elapsed time: 5.441

two CPU
total CPU time: 6.000
Elapsed time: 15.195

this is very strange since each machine is connected with gig-ethernet. it should not take that long time.

I am thinking the latency which may be caused by mpi or pbs. Is it right way?
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 07:29 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,