times.h(3HEAD) Headers times.h(3HEAD)NAME
times.h, times - file access and modification times structure
SYNOPSIS
#include <sys/times.h>
DESCRIPTION
The <sys/times.h> header defines the structure tms, which is returned by times() and includes the following members:
clock_t tms_utime /* user CPU time */
clock_t tms_stime /* system CPU time */
clock_t tms_cutime /* user CPU time of terminated child processes */
clock_t tms_cstime /* system CPU time of terminated child processes */
The clock_t type is defined as described in <sys/types.h>.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO times(2), types.h(3HEAD), attributes(5), standards(5)SunOS 5.10 10 Sep 2004 times.h(3HEAD)
Check Out this Related Man Page
times(2) System Calls times(2)NAME
times - get process and child process times
SYNOPSIS
#include <sys/times.h>
#include <limits.h>
clock_t times(struct tms *buffer);
DESCRIPTION
The times() function fills the tms structure pointed to by buffer with time-accounting information. The tms structure, defined in
<sys/times.h>, contains the following members:
clock_t tms_utime;
clock_t tms_stime;
clock_t tms_cutime;
clock_t tms_cstime;
All times are reported in clock ticks. The specific value for a clock tick is defined by the variable CLK_TCK, found in the header <lim-
its.h>.
The times of a terminated child process are included in the tms_cutime and tms_cstime members of the parent when wait(3C) or waitpid(3C)
returns the process ID of this terminated child. If a child process has not waited for its children, their times will not be included in
its times.
The tms_utime member is the CPU time used while executing instructions in the user space of the calling process.
The tms_stime member is the CPU time used by the system on behalf of the calling process.
The tms_cutime member is the sum of the tms_utime and the tms_cutime of the child processes.
The tms_cstime member is the sum of the tms_stime and the tms_cstime of the child processes.
RETURN VALUES
Upon successful completion, times() returns the elapsed real time, in clock ticks, since an arbitrary point in the past (for example, sys-
tem start-up time). This point does not change from one invocation of times() within the process to another. The return value may overflow
the possible range of type clock_t. If times() fails, (clock_t)-1 is returned and errno is set to indicate the error.
ERRORS
The times() function will fail if:
EFAULT The buffer argument points to an illegal address.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO time(1), timex(1), exec(2), fork(2), time(2), waitid(2), wait(3C), waitpid(3C), attributes(5), standards(5)SunOS 5.11 14 May 1997 times(2)
Hi
I'm running 4 jobs in the background and I need to write the start and end times to a log file. I know there's probably a simple way to do this but, I can't think of it. I've used nohup <script name> & but, that doesn't record the times. Is there a way to get the start and end times of a... (2 Replies)
i have a file which contains the data as below,
789990
789990
789990
789990
334989
334989
789990
-- here the no 789990 is repeated 5 times and 334989 is 2 times.
i want the output to be,
789990
334989 i.e only one entry of the repeated nos. (4 Replies)
Hi All,
I wrote one simple for loop shell script which prints number..but this loop is infinite...but its taking lot of CPU (15.7) %. if i am using sleep cmd then cpu usage become 0.4 %. Is there anyway to reduce this CPU usage without using sleep cmd?
i dont want 2 use sleep cmd... (7 Replies)
Can some body tune the below command, its occupyinh more than 90% of CPU some times.
tail -n 1000 /logs/trace.log | awk 'BEGIN{OOM = 0; ScE = 0; NaE = 0; Jms = 0}
/OutOfMemoryException/{OOM = 1}
/StaleConnectionException/{ScE = 1}
/NamingException/{NaE = 1}
/JmsTimeOutException/{Jms = 1}... (17 Replies)
OS is HP
Number of CPU available is 4
I am running 8 multiple parallel application processes. I observed that the application is NOT able to occupy maximum CPU. Out of 4, 2 of them are used by 89% and 11% respectively. Where as other two are always sitting idle.
Can anyone please comment... (3 Replies)
Try to imagine a flag:
nnnnx
nnnxx
nnxxx
nxxxx
now imagine how it will output:
4 times the "n"and 1 times "x"
3 times "n"and" 2 times" x "
.. etc. ..
rhombus is the same only instead of "n" is there
gap "and " x "is a few times to form the correct shape
Can you help... (3 Replies)
I have a scenario where 2 applications(sever,deploy) are running in parallel....Now in a span of 1hr i want to know exact %CPU(user CPU) these are using.
For example:
for a snap shot of 1 hr say 10 am to 11 am i need the CPU utilization as below
Total CPU=100 -->User... (1 Reply)
Hi Experts,
We encountered problem in one of the production system where some processes were taking higher CPU and after some time it came back to normal..
From system prespective, is there any way to check why processes took more cpu during that particular period. (16 Replies)
Hello geeks once again, many thanks for help in times past, you guys are awesome!
But am here again, but now this is way heavy for me. Find below for my challenge:
*** I need to collect CPU & RAM stats across 26 servers.
*** I don't have the luxury of deploying an NMS, if I had it would... (3 Replies)
Hi all.
I have a question about linux command to find number of CPU and Core.
I usually use the command dmidecode -t processor to find cpu and core numbers . On this machine with Red Hat 4. 0 when I try to insert the command is returned the error
-bash: dmidecode: command not found
I try to... (8 Replies)