Sponsored Content
Full Discussion: Total Time
Top Forums Shell Programming and Scripting Total Time Post 302526623 by kumaran_5555 on Wednesday 1st of June 2011 04:40:10 AM
Old 06-01-2011
You may refer the man page of time.

real - starts counting from the moment you start the command to the command's termination, includes all scheduling delays, this would be your elapsed time.
user - how much time it has executed in used mode
sys - how much time in kernel mode
Code:
       o  The elapsed (real) time between invocation  of  utility
          and its termination.

       o  The User  CPU  time,  equivalent  to  the  sum  of  the
          tms_utime   and   tms_cutime  fields  returned  by  the
          times(2) function for the process in which  utility  is
          executed.

       o  The System CPU time,  equivalent  to  the  sum  of  the
          tms_stime and tms_cstime fields returned by the times()
          function for the process in which utility is executed.

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep running total/ final total across multiple files

Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
Discussion started by: MrAd
5 Replies

2. UNIX for Dummies Questions & Answers

du total

Hi All Can anyone help me with the following du querry. I am trying to achieve a total size for all the zipped files in a directory. Using du -k *.gz gets me a file by file list but no handy total at the bottom. Thanks Ed (9 Replies)
Discussion started by: C3000
9 Replies

3. Shell Programming and Scripting

Calculate total space, total used space and total free space in filesystem names matching keyword

Good afternoon! Im new at scripting and Im trying to write a script to calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting... (4 Replies)
Discussion started by: bigben1220
4 Replies

4. Shell Programming and Scripting

How to get total time using awk

Hi guys, I can't find a solution to sum the h:m:s: columns. 28/05/2010 03h 29min 34seg ADSL TELEMAR 28/05/2010 12h 19min 21seg ADSL TELEMAR 29/05/2010 04h 20min 02seg ADSL TELEMAR 29/05/2010 04h 31min 45seg ADSL TELEMAR 30/05/2010 06h 10min 43seg ADSL TELEMAR Thanks Use code... (8 Replies)
Discussion started by: ashimada
8 Replies

5. Shell Programming and Scripting

Help with sum total number of record and total number of record problem asking

Input file SFSQW 5192.56 HNRNPK 611.486 QEQW 1202.15 ASDR 568.627 QWET 6382.11 SFSQW 4386.3 HNRNPK 100 SFSQW 500 Desired output file SFSQW 10078.86 3 QWET 6382.11 1 QEQW 1202.15 1 HNRNPK 711.49 2 ASDR 568.63 1 The way I tried: (2 Replies)
Discussion started by: patrick87
2 Replies

6. Shell Programming and Scripting

Total time taken

Hi Friend, Need your help. I have a file which has information of start time and End time . I need to find how much time takes to complete the job . how can I do it in unix command . Example of Log file : Start Loading ---Thu Aug 2 17:14:09 EDT 2012 Load... (5 Replies)
Discussion started by: deep_kol
5 Replies

7. UNIX for Dummies Questions & Answers

Dig total query time?

I'm using a .txt file filled with domain names for dig to use, the problem is that when i look at the results I get the query time for each individual query, I want to know how long it took in total for all queries to run, how can I achieve this? any help would be greatly appreciated, thank you.... (3 Replies)
Discussion started by: r7a7v7
3 Replies

8. Solaris

Total

i want to list Total HDD count in any soalris machine..can someone suggest some commands or combinations of commands (6 Replies)
Discussion started by: omkar.jadhav
6 Replies

9. UNIX for Beginners Questions & Answers

Total size utilizes by the files older than a time span

Through find command I identified the files older that 1 year. I need the overall size utilizes by these 1 year older files. Please share me the command to identify it .Thanks Please post in an adequate technical forum! (3 Replies)
Discussion started by: Sang
3 Replies
TIMES(2)						     Linux Programmer's Manual							  TIMES(2)

NAME
times - get process times SYNOPSIS
#include <sys/times.h> clock_t times(struct tms *buf); DESCRIPTION
times() stores the current process times in the struct tms that buf points to. The struct tms is as defined in <sys/times.h>: struct tms { clock_t tms_utime; /* user time */ clock_t tms_stime; /* system time */ clock_t tms_cutime; /* user time of children */ clock_t tms_cstime; /* system time of children */ }; The tms_utime field contains the CPU time spent executing instructions of the calling process. The tms_stime field contains the CPU time spent in the system while executing tasks on behalf of the calling process. The tms_cutime field contains the sum of the tms_utime and tms_cutime values for all waited-for terminated children. The tms_cstime field contains the sum of the tms_stime and tms_cstime values for all waited-for terminated children. Times for terminated children (and their descendants) are added in at the moment wait(2) or waitpid(2) returns their process ID. In par- ticular, times of grandchildren that the children did not wait for are never seen. All times reported are in clock ticks. RETURN VALUE
times() returns the number of clock ticks that have elapsed since an arbitrary point in the past. The return value may overflow the possi- ble range of type clock_t. On error, (clock_t) -1 is returned, and errno is set appropriately. ERRORS
EFAULT tms points outside the process's address space. CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001. NOTES
The number of clock ticks per second can be obtained using: sysconf(_SC_CLK_TCK); In POSIX.1-1996 the symbol CLK_TCK (defined in <time.h>) is mentioned as obsolescent. It is obsolete now. In Linux kernel versions before 2.6.9, if the disposition of SIGCHLD is set to SIG_IGN then the times of terminated children are automati- cally included in the tms_cstime and tms_cutime fields, although POSIX.1-2001 says that this should only happen if the calling process wait(2)s on its children. This nonconformance is rectified in Linux 2.6.9 and later. On Linux, the buf argument can be specified as NULL, with the result that times() just returns a function result. However, POSIX does not specify this behavior, and most other UNIX implementations require a non-NULL value for buf. Note that clock(3) also returns a value of type clock_t, but this value is measured in units of CLOCKS_PER_SEC, not the clock ticks used by times(). On Linux, the "arbitrary point in the past" from which the return value of times() is measured has varied across kernel versions. On Linux 2.4 and earlier this point is the moment the system was booted. Since Linux 2.6, this point is (2^32/HZ) - 300 (i.e., about 429 million) seconds before system boot time. This variability across kernel versions (and across UNIX implementations), combined with the fact that the returned value may overflow the range of clock_t, means that a portable application would be wise to avoid using this value. To mea- sure changes in elapsed time, use clock_gettime(2) instead. Historical SVr1-3 returns long and the struct members are of type time_t although they store clock ticks, not seconds since the Epoch. V7 used long for the struct members, because it had no type time_t yet. BUGS
A limitation of the Linux system call conventions on some architectures (notably i386) means that on Linux 2.6 there is a small time window (41 seconds) soon after boot when times() can return -1, falsely indicating that an error occurred. The same problem can occur when the return value wraps passed the maximum value that can be stored in clock_t. SEE ALSO
time(1), getrusage(2), wait(2), clock(3), sysconf(3), time(7) COLOPHON
This page is part of release 3.44 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2012-10-22 TIMES(2)
All times are GMT -4. The time now is 01:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy