LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-07-2011, 01:54 PM   #1
chaitanyajun12
Member
 
Registered: Nov 2010
Posts: 38

Rep: Reputation: 0
Smile user time, system time, real time .. reg


1. how sum of system time and user time can be greater than real time ?
2. Even though my program is not waiting for any I/O the real time is smaller than system time as shown


root@chaitu:/home/chaitu/Desktop/Chk# time ./new

real 0m0.001s
user 0m0.000s
sys 0m0.004s

Awaiting a reply.
 
Old 04-07-2011, 02:08 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
I think thats because the computer is faster than real time - 'Wall Clock Time'

For example.

Real time might be 1 minute.

But the computer can do 600 minutes of work in 1 minute. Its been a long time since I've studied this, so please correct me if I am mistaken.
 
Old 04-07-2011, 02:20 PM   #3
chaitanyajun12
Member
 
Registered: Nov 2010
Posts: 38

Original Poster
Rep: Reputation: 0
thanks for ur reply..
the things which I know regarding this are:

real time is the actual elapsed time(from beginning to end of the program)
user time includes time needed for executing user defined code.
System time for executing system calls(kernel time).

but I am confused as to how system time can be greater than real time. even i am not clear with it.

just waiting for someone to answer.

Chaitanya.

Last edited by chaitanyajun12; 04-07-2011 at 02:23 PM.
 
Old 04-07-2011, 08:30 PM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by szboardstretcher View Post
But the computer can do 600 minutes of work in 1 minute. Its been a long time since I've studied this, so please correct me if I am mistaken.
I don't understand. What's a "minute of work", anyway? How can a computer do in 1/600 of a minute what it could do in a minute?
 
Old 04-08-2011, 12:18 AM   #5
chaitanyajun12
Member
 
Registered: Nov 2010
Posts: 38

Original Poster
Rep: Reputation: 0
This thing would be of great help for me.
Someone can please explain it.


--
Chaitanya
 
Old 03-14-2016, 01:32 PM   #6
gon1332
LQ Newbie
 
Registered: Mar 2016
Posts: 1

Rep: Reputation: Disabled
It is absolutely logical that sometimes the wall clock time (real) is smaller than the sum of sys and user time.

Sys and user time is the time that CPU spends within the process. If you have an application with multithreading, then the time could be larger than that of real.

Also real time could be way larger than the sum of sys and user time, because of blocking actions like IO.
 
Old 03-14-2016, 02:58 PM   #7
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Real time on a PC with a CPU is referring to clock time of the CPU, to call and execute a function call in real time is -- "right now" without delay, this is machine language that manipulates the hardware of the system, whereas software has a delay to it due to having to go through the API or a driver therefore, not actually speaking to the hardware directly. Hence a delay in time occurs due to this effect of having to go through a proxy of sorts first before the hardware actually receives the call to do something. It is not real time programming but that other one which the name of it escapes me at this moment.

Real-time computing
Quote:
In computer science, real-time computing, or reactive computing describes hardware and software systems subject to a "real-time constraint", for example from event to system response. Real-time programs must guarantee response within specified time constraints, often referred to as "deadlines". Real-time responses are often understood to be in the order of milliseconds, and sometimes microseconds. A system not specified as operating in real time cannot usually guarantee a response within any timeframe, although actual or expected response times may be given.
therefore anything other programming will be slower then "real time" if it is not machine code assembly language.

Last edited by BW-userx; 03-14-2016 at 03:11 PM.
 
Old 03-14-2016, 05:43 PM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Actually, the most likely explanation in this case is that your times are just too small to measure (meaningfully). When you're dealing in the realm of "0.00x seconds," 'irrelevant curiosities' (ahem...) may appear.
 
  


Reply



Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to understand user time, sys time, wait time, idle time of CPU guixingyi Linux - Server 1 08-24-2010 10:10 AM
how do i get the values for the user time and system time for a process. aloktiagi Linux - Newbie 3 08-04-2009 06:55 PM
System time vs Hardware time and Daylight Savings Time Toadman Linux - General 6 03-17-2007 08:12 AM
System time vs Hardware time and Daylight Savings Time Toadman Linux - Networking 6 03-16-2007 07:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration