Sponsored Content
Top Forums Shell Programming and Scripting How to calculate time difference between start and end time of a process! Post 302450418 by jlliagre on Thursday 2nd of September 2010 02:09:20 PM
Old 09-02-2010
What OS are you 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
Test::MockTime(3pm)					User Contributed Perl Documentation				       Test::MockTime(3pm)

NAME
Test::MockTime - Replaces actual time with simulated time SYNOPSIS
use Test::MockTime qw( :all ); set_relative_time(-600); # do some tests depending on time increasing from 600 seconds ago set_absolute_time(0); # do some more tests depending on time starting from the epoch # epoch may vary according to platform. see perlport. set_fixed_time(CORE::time()); # do some more tests depending on time staying at the current actual time set_absolute_time('1970-01-01T00:00:00Z'); # do some tests depending on time starting at Unix epoch time set_fixed_time('01/01/1970 00:00:00', '%m/%d/%Y %H:%M:%S'); # do some tests depending on time staying at the Unix epoch time restore_time(); # resume normal service DESCRIPTION
This module was created to enable test suites to test code at specific points in time. Specifically it overrides localtime, gmtime and time at compile time and then relies on the user supplying a mock time via set_relative_time, set_absolute_time or set_fixed_time to alter future calls to gmtime,time or localtime. Functions set_absolute_time If given a single, numeric argument, the argument is an absolute time (for example, if 0 is supplied, the absolute time will be the epoch), and calculates the offset to allow subsequent calls to time, gmtime and localtime to reflect this. for example, in the following code Time::Mock::set_absolute_time(0); my ($start) = time; sleep 2; my ($end) = time; The $end variable should contain 2 seconds past the epoch; If given two arguments, the first argument is taken to be an absolute time in some string format (for example, "01/01/1970 00:00:00"). The second argument is taken to be a "strptime" format string (for example, "%m/%d/%Y %H:%M:%S"). If a single argument is given, but that argument is not numeric, a "strptime" format string of "%Y-%m-%dT%H:%M:%SZ" is assumed. for example, in the following code Time::Mock::set_absolute_time('1970-01-01T00:00:00Z'); my ($start) = time; sleep 2; my ($end) = time; The $end variable should contain 2 seconds past the Unix epoch; set_relative_time($relative) takes as an argument an relative value from current time (for example, if -10 is supplied, current time be converted to actual machine time - 10 seconds) and calculates the offset to allow subsequent calls to time,gmtime and localtime to reflect this. for example, in the following code my ($start) = time; Time::Mock::set_relative_time(-600); sleep 600; my ($end) = time; The $end variable should contain either the same or very similar values to the $start variable. set_fixed_time If given a single, numeric argument, the argument is an absolute time (for example, if 0 is supplied, the absolute time will be the epoch). All subsequent calls to gmtime, localtime and time will return this value. for example, in the following code Time::Mock::set_fixed_time(time) my ($start) = time; sleep 3; my ($end) = time; the $end variable and the $start variable will contain the same results If given two arguments, the first argument is taken to be an absolute time in some string format (for example, "01/01/1970 00:00:00"). The second argument is taken to be a "strptime" format string (for example, "%m/%d/%Y %H:%M:%S"). If a single argument is given, but that argument is not numeric, a "strptime" format string of "%Y-%m-%dT%H:%M:%SZ" is assumed. restore() restore the default time handling values. "restore_time" is an alias. When exported with the 'all' tag, this subroutine is exported as "restore_time". AUTHOR
David Dick <ddick@cpan.org> PREREQUISITES
Time::Piece 1.08 or greater BUGS
Probably. COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. ACKNOWLEDGEMENTS
Thanks to a use.perl.org journal entry <http://use.perl.org/~geoff/journal/20660> by Geoffrey Young. perl v5.10.0 2008-06-29 Test::MockTime(3pm)
All times are GMT -4. The time now is 08:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy