Sponsored Content
Top Forums Shell Programming and Scripting How to calculate time difference between start and end time of a process! Post 302450455 by hakermania on Thursday 2nd of September 2010 04:43:41 PM
Old 09-02-2010
time {application name goes here}

the real time is the time that the process was running
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Start time/end time and status of crontab job

Is there anyway to get the start time and end time / status of a crontab job which was just completed? Of course, we know the start time of the crontab job since we are scheduling. But I would like to know process start and time recorded somewhere or can be fetched from a command like 'ps'. ... (3 Replies)
Discussion started by: thambi
3 Replies

2. Shell Programming and Scripting

How to calculate this time difference

Hi, Please help me in calculating the time difference between below mentioned timestamps. a=07/17/2007 02:20:00 AM MST b=07/17/2007 02:07:46 AM MST Thanks (2 Replies)
Discussion started by: Prat007
2 Replies

3. Shell Programming and Scripting

How to calculate the time difference...

Hi All, I've written a script which reads all the systems backup information and saves it in a log file. ssh -l ora${sid} ${primaryhost} "tail -2 /oracle/$ORACLE_SID/sapbackup/back$ORACLE_SID.log" |head -1 | awk '{print echo "PREVIOUS:-- Start Date&Time: " $3,$4,echo "|| End Date&Time:... (1 Reply)
Discussion started by: suri.tyson
1 Replies

4. Shell Programming and Scripting

How to calculate the time difference.

Hi All, I've written a script which reads all the systems backup information and saves it in a log file. ssh -l ora${sid} ${primaryhost} "tail -1 /oracle/$ORACLE_SID/sapbackup/back$ORACLE_SID.log" | awk '{print $3,$4,$5,$6}' >> ${RESULTFILE} The output comes as below: 2008-09-30 06.00.01... (2 Replies)
Discussion started by: suri.tyson
2 Replies

5. Shell Programming and Scripting

How to get data between the start time and end time?

Hi, Can anyone help me how can I get the line that between the start time and end time. file1.txt 15/03/2009 20:45:03 Request: - Data of this line 15/03/2009 20:45:12 Response: - Data of this line 15/03/2009 22:10:40 Request: - Data of this line 15/03/2009 22:10:42 Response: - Data of... (1 Reply)
Discussion started by: tanit
1 Replies

6. Linux

Process start time not showing correct time

Process start time is not showing the correct time: I had started a process on Jun 17th at 23:30:00. Next day morning when I run the command "ps -ef | grep mq", the process is showing the start date of Jun 17th but the start time is 00:16:41 Day/Date is setup correctly on the server. It... (2 Replies)
Discussion started by: hemangjani
2 Replies

7. Shell Programming and Scripting

Calculate age of a file | calculate time difference

Hello, I'm trying to create a shell script (#!/bin/sh) which should tell me the age of a file in minutes... I have a process, which delivers me all 15 minutes a new file and I want to have a monitoring script, which sends me an email, if the present file is older than 20 minutes. To do... (10 Replies)
Discussion started by: worm
10 Replies

8. Shell Programming and Scripting

Calculate time difference

I have time in a file in HH:MM:SS format as it contents(its not the file creation time). i need this to be converted to epoch time or time since 1970. The time is written into that file by a script, which i cannot modify. Im using AIX machine $ cat abc.txt 10:29:34 (2 Replies)
Discussion started by: gpk_newbie
2 Replies

9. Shell Programming and Scripting

Calculate time difference between two lines

i grepped the time stamp in a file as given below now i need to calculate time difference file data: 18:29:10 22:15:50 (5 Replies)
Discussion started by: vivekn
5 Replies
getitimer(2)							System Calls Manual						      getitimer(2)

Name
       getitimer, setitimer - get or set value of interval timer

Syntax
       #include <sys/time.h>

       #define ITIMER_REAL	0    /* real time intervals */
       #define ITIMER_VIRTUAL	1    /* virtual time intervals */
       #define ITIMER_PROF	2    /* user and system virtual time */

       getitimer(which, value)
       int which;
       struct itimerval *value;

       setitimer(which, value, ovalue)
       int which;
       struct itimerval *value, *ovalue;

Description
       The  system  provides  each  process with three interval timers, defined in <sys/time.h>.  The call returns the current value for the timer
       specified in which, while the call sets the value of a timer (optionally, returning the previous value of the timer).  The upper limit  for
       time values are as follows:

	  For VAX machines, 10millisec * 0x7fffffff  (about 256 days)
	  For RISC machines, 3.906 millsec * 0x7fffffff (about 97 days)

       A timer value is defined by the itimerval structure:
       struct itimerval {
	     struct  timeval it_interval; /* timer interval */
	     struct  timeval it_value;	  /* current value */
       };

       If  it_value is nonzero, it indicates the time to the next timer expiration.  If it_interval is nonzero, it specifies a value to be used in
       reloading it_value when the timer expires.  Setting it_value to 0 disables a timer.  Setting it_interval to 0 causes a timer to be disabled
       after its next expiration (assuming it_value is nonzero).

       Time values smaller than the resolution of the system clock are rounded up to this resolution (on MIPS, 3.906 milliseconds; on VAX, 10 mil-
       liseconds).

       The ITIMER_REAL timer decrements in real time.  A SIGALRM signal is delivered when this timer expires.

       The ITIMER_VIRTUAL timer decrements in process virtual time.  It runs only when the process is executing.  A SIGVTALRM signal is  delivered
       when it expires.

       The  ITIMER_PROF  timer decrements both in process virtual time and when the system is running on behalf of the process.  It is designed to
       be used by interpreters in statistically profiling the execution of interpreted programs.  Each time the  ITIMER_PROF  timer  expires,  the
       SIGPROF	signal	is  delivered.	 Because this signal may interrupt in-progress system calls, programs using this timer must be prepared to
       restart interrupted system calls.

       Three macros for manipulating time values are defined in <sys/time.h>.  The timerclear sets a time value to zero,  timerisset  tests  if  a
       time value is nonzero, and timercmp compares two time values (beware that >= and <= do not work with this macro).

Return Values
       If  the	calls succeed, a value of 0 is returned.  If an error occurs, the value -1 is returned, and a more precise error code is placed in
       the global variable, errno.

Diagnostics
       The possible errors are:

       [EFAULT]       The value structure specified a bad address.

       [EINVAL]       A value structure specified a time that was too large to be handled.

See Also
       gettimeofday(2), sigvec(2), pause(3)

																      getitimer(2)
All times are GMT -4. The time now is 08:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy