BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cobrad
Fluorite | Level 6

Dear SAS

 

What is the difference between Real Time and CPU Time?

 

What makes the one faster than the other? I have noticed in my log that sometimes when a data step runs quickly the CPU Time can be longer than the Real Time, but on the long/large run times the Real Time is always very much longer than the CPU Time.

 

Thanks for you help!!

1 ACCEPTED SOLUTION

Accepted Solutions
rivieralad
Obsidian | Level 7
Quick/simple answer, but I am sure someone will provide a far more technical response.

Real Time is the actual, real world, time that the step takes to run and will be the same as if you timed it with a stopwatch (not possible as you won't know the precise moment the step starts and stops).

CPU Time is the amount of time the step utilises CPU resources. If the machine on which the step is running has only a single CPU then the total CPU time would always be less than than the real time.

However, with multiple processor machines, the load is spread across multiple CPU's and the total CPU time (as reported on the log) may be longer than the real time, e.g. a data step may take 2.6 seconds of real time to execute but the load is spread across 4 CPUs, utilising 1 second of resource on each, so the CPU time will be 4 seconds, i.e. 1.4 seconds longer than the real time.

The nature of the step will heavily influence the real and CPU times, processing data will utilise the CPU but data i/o will increase real time as the data is read from and written back to disk.

There is a lot of information about performance techniques, utilising in-memory processing, etc., available on the web.

Hope this helps.

Cheers

Chris

View solution in original post

6 REPLIES 6
rivieralad
Obsidian | Level 7
Quick/simple answer, but I am sure someone will provide a far more technical response.

Real Time is the actual, real world, time that the step takes to run and will be the same as if you timed it with a stopwatch (not possible as you won't know the precise moment the step starts and stops).

CPU Time is the amount of time the step utilises CPU resources. If the machine on which the step is running has only a single CPU then the total CPU time would always be less than than the real time.

However, with multiple processor machines, the load is spread across multiple CPU's and the total CPU time (as reported on the log) may be longer than the real time, e.g. a data step may take 2.6 seconds of real time to execute but the load is spread across 4 CPUs, utilising 1 second of resource on each, so the CPU time will be 4 seconds, i.e. 1.4 seconds longer than the real time.

The nature of the step will heavily influence the real and CPU times, processing data will utilise the CPU but data i/o will increase real time as the data is read from and written back to disk.

There is a lot of information about performance techniques, utilising in-memory processing, etc., available on the web.

Hope this helps.

Cheers

Chris
Cobrad
Fluorite | Level 6
Thanks Chris



This really helps a lot!!



Have a great day.



C.


ballardw
Super User

You might be interested in setting the system option FULLSTIMER for some jobs to show more performance related information. The default setting is usually NOFULLSTIMER .

 

If interested add:

 

options FULLSTIMER;

before the data step or procedures you are interested in.

Cobrad
Fluorite | Level 6
Awesome - thanks a lot for the info.



Much appreciated.



C.


sgarg-tester
Calcite | Level 5

Hello Chris,

 

Thanks for the reply. I have a question (or confusion) w.r.t. real time definition here. In my view, SAS has its Real World defined in terms of Code, CPUs, Memory, Network, Hardware etc. which in turn may be interacting with system say an Oracle database which has similar Real World. So, please correct me If I am wrong. I interpreted your answer as...

 

Real World is - When a user's program gets executed on SAS system and assume it is creating and printing a SAS DataSet by fetching some data from an Oracle database, then real world time means the total turn around time for the entire operation including Compile time, Syntax checking, Memory allocation, data set creation and so on until data is being printed and displayed to the user.

 

CPU Time is - For this entire set of activities, how much time is taken by CPU only? But isn't everything needs a CPU time?

 

Please guide.

 

Thanks

-Sandeep

ChrisNZ
Tourmaline | Level 20

>But isn't everything needs a CPU time?

 

No. Often, the CPU is waiting for the disk or the network, or even the RAM, and can't process anything. Idle CPU time is not CPU time.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 42342 views
  • 12 likes
  • 5 in conversation